diff --git a/.travis.yml b/.travis.yml index 9bc9e12..145f909 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,23 @@ language: php -php: -# - 5.3 # requires old distro, see below - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - hhvm # ignore errors, see below - # lock distro so new future defaults will not break the build dist: trusty -matrix: +jobs: include: - php: 5.3 dist: precise + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4 + - php: hhvm-3.18 allow_failures: - - php: hhvm - -sudo: false + - php: hhvm-3.18 install: - composer install --no-interaction diff --git a/composer.json b/composer.json index 7fe0bc3..8b2899b 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,6 @@ "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3", "react/promise-timer": "^1.0", "clue/block-react": "^1.0", - "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^9.0 || ^5.7 || ^4.8.35" } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a40caa1..e68991a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,6 @@ - + ./tests/ diff --git a/tests/CallableStub.php b/tests/CallableStub.php deleted file mode 100644 index f398c04..0000000 --- a/tests/CallableStub.php +++ /dev/null @@ -1,10 +0,0 @@ -getMockBuilder('React\Tests\Promise\Stream\CallableStub')->getMock(); + if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) { + // PHPUnit 9+ + return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock(); + } else { + // legacy PHPUnit 4 - PHPUnit 9 + return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock(); + } } protected function expectPromiseResolve($promise) diff --git a/tests/UnwrapReadableTest.php b/tests/UnwrapReadableTest.php index a6db4de..59c578f 100644 --- a/tests/UnwrapReadableTest.php +++ b/tests/UnwrapReadableTest.php @@ -13,7 +13,10 @@ class UnwrapReadableTest extends TestCase { private $loop; - public function setUp() + /** + * @before + */ + public function setUpLoop() { $this->loop = Factory::create(); } diff --git a/tests/UnwrapWritableTest.php b/tests/UnwrapWritableTest.php index 07cc8e3..ecf003c 100644 --- a/tests/UnwrapWritableTest.php +++ b/tests/UnwrapWritableTest.php @@ -14,7 +14,10 @@ class UnwrapWritableTest extends TestCase { private $loop; - public function setUp() + /** + * @before + */ + public function setUpLoop() { $this->loop = Factory::create(); }