diff --git a/.travis.yml b/.travis.yml index abb1cf2a..1c59030d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: php # lock distro so new future defaults will not break the build dist: trusty -matrix: +jobs: include: - php: 5.3 dist: precise @@ -16,12 +16,9 @@ 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 -sudo: false - install: - composer install --no-interaction diff --git a/tests/CallableStub.php b/tests/CallableStub.php deleted file mode 100644 index a34a263a..00000000 --- a/tests/CallableStub.php +++ /dev/null @@ -1,10 +0,0 @@ -markTestSkipped('Not supported on HHVM'); + } + $writableCallback = null; $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addWriteStream')->with($this->anything(), $this->callback(function ($cb) use (&$writableCallback) { diff --git a/tests/TestCase.php b/tests/TestCase.php index 2c0c0cf1..6ea467e6 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -39,7 +39,13 @@ protected function expectCallableNever() protected function createCallableMock() { - return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->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(); + } } public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null)