diff --git a/.travis.yml b/.travis.yml index e5d2dc2..23321dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ matrix: env: PHPUNIT=~5.7 - php: 7.1 env: PHPUNIT=~6 + - php: 7.2 + env: PHPUNIT=~6 - php: nightly env: PHPUNIT=~6 - php: hhvm diff --git a/composer.json b/composer.json index fb2ed94..c28dd02 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": ">=5.6", - "phpunit/phpunit": ">=5.7 <7" + "phpunit/phpunit": "^5.7 || ^6.5" }, "autoload": { "psr-4": { "MyBuilder\\PhpunitAccelerator\\": "src" } diff --git a/src/TestListener.php b/src/TestListener.php index c1f5c50..28857c6 100644 --- a/src/TestListener.php +++ b/src/TestListener.php @@ -4,7 +4,7 @@ use PHPUnit\Framework\BaseTestListener; -if (!interface_exists('\PHPUnit\Framework\Test')) { +if(interface_exists('\PHPUnit_Framework_Test')) { class_alias('\PHPUnit_Framework_Test', '\PHPUnit\Framework\Test'); } diff --git a/tests/TestListenerTest.php b/tests/TestListenerTest.php index 7ebc91a..5c2cc52 100644 --- a/tests/TestListenerTest.php +++ b/tests/TestListenerTest.php @@ -12,10 +12,12 @@ protected function setUp() $this->dummyTest = new DummyTest(); } - /** - * @test - */ - public function shouldFreeTestProperty() + protected function tearDown() + { + unset($this->dummyTest); + } + + public function testShouldFreeTestProperty() { $this->endTest(new TestListener()); @@ -32,10 +34,7 @@ private function assertFreesTestProperty() $this->assertNull($this->dummyTest->property); } - /** - * @test - */ - public function shouldNotFreePhpUnitProperty() + public function testShouldNotFreePhpUnitProperty() { $this->endTest(new TestListener()); @@ -47,10 +46,7 @@ private function assertDoesNotFreePHPUnitProperty() $this->assertNotNull($this->dummyTest->phpUnitProperty); } - /** - * @test - */ - public function shouldNotFreeTestPropertyWithIgnoreAlwaysPolicy() + public function testShouldNotFreeTestPropertyWithIgnoreAlwaysPolicy() { $this->endTest(new TestListener(new AlwaysIgnoreTestPolicy()));