diff --git a/.travis.yml b/.travis.yml index da52bb1..8e65657 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ php: - 5.5 - 5.6 - 7.0 + - 7.1 env: global: @@ -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" diff --git a/composer.json b/composer.json index d6a74e3..3f7d609 100755 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/tests/Case/Fabricate/Definition/FabricateDefinitionTest.php b/tests/Case/Fabricate/Definition/FabricateDefinitionTest.php index 81af880..3aa3dac 100644 --- a/tests/Case/Fabricate/Definition/FabricateDefinitionTest.php +++ b/tests/Case/Fabricate/Definition/FabricateDefinitionTest.php @@ -1,12 +1,13 @@ -assertEquals(['name'=>'taro'], $data); @@ -25,4 +26,4 @@ public function testRunNullDefinition() { $target = new FabricateDefinition(null); $this->assertEquals([], $target->run(['name'=>'taro'], 'world')); } -} \ No newline at end of file +} diff --git a/tests/Case/Fabricate/FabricateContextTest.php b/tests/Case/Fabricate/FabricateContextTest.php index db98275..7f76777 100644 --- a/tests/Case/Fabricate/FabricateContextTest.php +++ b/tests/Case/Fabricate/FabricateContextTest.php @@ -1,13 +1,14 @@ -Config = new FabricateConfig(); @@ -53,4 +54,4 @@ public function testGetFakerInstance() { $this->Config->faker = \Faker\Factory::create(); $this->assertSame($this->Config->faker, $this->Context->faker()); } -} \ No newline at end of file +} diff --git a/tests/Case/Fabricate/FabricateRegistryTest.php b/tests/Case/Fabricate/FabricateRegistryTest.php index 92c69b4..0fb35ab 100644 --- a/tests/Case/Fabricate/FabricateRegistryTest.php +++ b/tests/Case/Fabricate/FabricateRegistryTest.php @@ -1,14 +1,15 @@ -Registry->clear(); $this->Registry->find('FabricateRegistryTestComment'); } -} \ No newline at end of file +} diff --git a/tests/Case/Fabricate/FabricateSequenceTest.php b/tests/Case/Fabricate/FabricateSequenceTest.php index b60004e..619e7fe 100644 --- a/tests/Case/Fabricate/FabricateSequenceTest.php +++ b/tests/Case/Fabricate/FabricateSequenceTest.php @@ -1,12 +1,13 @@ -Sequence = new FabricateSequence(1); @@ -20,4 +21,4 @@ public function testNext() { $this->assertEquals(2, $this->Sequence->next()); $this->assertEquals(2, $this->Sequence->current()); } -} \ No newline at end of file +} diff --git a/tests/Case/Fabricate/FabricateTest.php b/tests/Case/Fabricate/FabricateTest.php index 3c388db..0d002b1 100755 --- a/tests/Case/Fabricate/FabricateTest.php +++ b/tests/Case/Fabricate/FabricateTest.php @@ -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(); diff --git a/tests/Case/Fabricate/Factory/FabricateFactoryTest.php b/tests/Case/Fabricate/Factory/FabricateFactoryTest.php index afa0342..6f530e5 100644 --- a/tests/Case/Fabricate/Factory/FabricateFactoryTest.php +++ b/tests/Case/Fabricate/Factory/FabricateFactoryTest.php @@ -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') @@ -34,4 +35,4 @@ public function testCreateDefinitionFactory() { public function testCreateThrowExceptionIfNotSupportInstance() { FabricateFactory::create('Not Supported'); } -} \ No newline at end of file +}