diff --git a/.travis.yml b/.travis.yml index 88db786..3e74fb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,6 @@ matrix: - php: 7.3 - php: 7.4 - php: hhvm-3.18 - install: composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit allow_failures: - php: hhvm-3.18 diff --git a/composer.json b/composer.json index 5f99c59..f3420b8 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,6 @@ "react/promise": "^3.0 || ^2.7.0 || ^1.2.1" }, "require-dev": { - "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 bb79fba..1685bd1 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 a391aa5..0000000 --- a/tests/CallableStub.php +++ /dev/null @@ -1,10 +0,0 @@ -loop = Factory::create(); } @@ -41,7 +44,13 @@ protected function expectCallableNever() */ protected function createCallableMock() { - return $this->getMockBuilder('React\Tests\Promise\Timer\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 expectPromiseRejected($promise)