Skip to content

Commit

Permalink
Merge pull request #28 from sizuhiko/develop
Browse files Browse the repository at this point in the history
Release 2.0.3
  • Loading branch information
sizuhiko authored Jun 26, 2017
2 parents f94b39d + 5a88c3d commit b7b870d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ php:
- 5.5
- 5.6
- 7.0
- 7.1

env:
global:
Expand Down Expand Up @@ -36,9 +37,9 @@ before_script:
- cp phpunit.xml.dist phpunit.xml

script:
- sh -c "if [ '$DEFAULT' = '1' ]; then phpunit --stderr; fi"
- sh -c "if [ '$DEFAULT' = '1' ]; then vendor/bin/phpunit --stderr; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then vendor/bin/phpcs -p --extensions=php --standard=ruleset.xml ./src; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then phpunit --stderr --coverage-clover build/logs/clover.xml; fi"
- sh -c "if [ '$COVERALLS' = '1' ]; then vendor/bin/phpunit --stderr --coverage-clover build/logs/clover.xml; fi"

after_script:
- sh -c "if [ '$COVERALLS' = '1' ]; then php vendor/bin/coveralls -c .coveralls.yml -v; fi"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"fzaninotto/faker": "~1.4"
},
"require-dev": {
"phpunit/phpunit": "*"
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
},
"suggest": {
"sizuhiko/cake_fabricate": "for integration with CakePHP3"
Expand Down
7 changes: 4 additions & 3 deletions tests/Case/Fabricate/Definition/FabricateDefinitionTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php
<?php
namespace Test\Fabricate\Definition;

use Fabricate\Definition\FabricateDefinition;
use PHPUnit\Framework\TestCase;

/**
* FabricateDefinition class test case
*/
class FabricateDefinitionTest extends \PHPUnit_Framework_TestCase {
class FabricateDefinitionTest extends TestCase {
public function testRunCallbackDefinition() {
$target = new FabricateDefinition(function($data, $world) {
$this->assertEquals(['name'=>'taro'], $data);
Expand All @@ -25,4 +26,4 @@ public function testRunNullDefinition() {
$target = new FabricateDefinition(null);
$this->assertEquals([], $target->run(['name'=>'taro'], 'world'));
}
}
}
7 changes: 4 additions & 3 deletions tests/Case/Fabricate/FabricateContextTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?php
<?php
namespace Test\Fabricate;

use Fabricate\FabricateConfig;
use Fabricate\FabricateContext;
use PHPUnit\Framework\TestCase;

/**
* Fabricate class test case
*/
class FabricateContextTest extends \PHPUnit_Framework_TestCase {
class FabricateContextTest extends TestCase {

public function setUp() {
$this->Config = new FabricateConfig();
Expand Down Expand Up @@ -53,4 +54,4 @@ public function testGetFakerInstance() {
$this->Config->faker = \Faker\Factory::create();
$this->assertSame($this->Config->faker, $this->Context->faker());
}
}
}
7 changes: 4 additions & 3 deletions tests/Case/Fabricate/FabricateRegistryTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php
<?php
namespace Test\Fabricate;

use Fabricate\FabricateRegistry;
use Fabricate\Adaptor\FabricateArrayAdaptor;
use Fabricate\Model\FabricateModel;
use PHPUnit\Framework\TestCase;

/**
* Fabricate class test case
*/
class FabricateRegistryTest extends \PHPUnit_Framework_TestCase {
class FabricateRegistryTest extends TestCase {
public function setUp() {
$adaptor = new FabricateArrayAdaptor();
$adaptor::$definitions = [
Expand Down Expand Up @@ -53,4 +54,4 @@ public function testFindThrowExceptionIfRegisteredObjectCleared() {
$this->Registry->clear();
$this->Registry->find('FabricateRegistryTestComment');
}
}
}
7 changes: 4 additions & 3 deletions tests/Case/Fabricate/FabricateSequenceTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php
<?php
namespace Test\Fabricate;

use Fabricate\FabricateSequence;
use PHPUnit\Framework\TestCase;

/**
* Fabricate class test case
*/
class FabricateSequenceTest extends \PHPUnit_Framework_TestCase {
class FabricateSequenceTest extends TestCase {

public function setUp() {
$this->Sequence = new FabricateSequence(1);
Expand All @@ -20,4 +21,4 @@ public function testNext() {
$this->assertEquals(2, $this->Sequence->next());
$this->assertEquals(2, $this->Sequence->current());
}
}
}
3 changes: 2 additions & 1 deletion tests/Case/Fabricate/FabricateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
use Fabricate\Fabricate;
use Fabricate\Adaptor\FabricateArrayAdaptor;
use Fabricate\Model\FabricateModel;
use PHPUnit\Framework\TestCase;

/**
* Fabricate class test case
*/
class FabricateTest extends \PHPUnit_Framework_TestCase {
class FabricateTest extends TestCase {
public function setUp() {
parent::setUp();
Fabricate::clear();
Expand Down
5 changes: 3 additions & 2 deletions tests/Case/Fabricate/Factory/FabricateFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
use Fabricate\Factory\FabricateFactory;
use Fabricate\Definition\FabricateDefinition;
use Fabricate\Model\FabricateModel;
use PHPUnit\Framework\TestCase;

/**
* FabricateFactory class test case
*/
class FabricateFactoryTest extends \PHPUnit_Framework_TestCase {
class FabricateFactoryTest extends TestCase {
public function setUp() {
$this->model = (new FabricateModel('Post'))
->addColumn('id', 'integer')
Expand All @@ -34,4 +35,4 @@ public function testCreateDefinitionFactory() {
public function testCreateThrowExceptionIfNotSupportInstance() {
FabricateFactory::create('Not Supported');
}
}
}

0 comments on commit b7b870d

Please sign in to comment.