From d9e59415e271743e10e0d59683759ba3607915e6 Mon Sep 17 00:00:00 2001 From: peter279k Date: Fri, 9 Feb 2018 14:06:13 +0800 Subject: [PATCH 1/2] add php-7.2 test,setcorrect the dependency version --- .travis.yml | 2 ++ composer.json | 2 +- tests/TestListenerTest.php | 20 ++++++++------------ 3 files changed, 11 insertions(+), 13 deletions(-) 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/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())); From f46d3f042c4d025235364c4a85415c3833537306 Mon Sep 17 00:00:00 2001 From: peter279k Date: Fri, 9 Feb 2018 15:13:15 +0800 Subject: [PATCH 2/2] check namespace PHPUnit_Framework_Test ,alias new --- src/TestListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'); }