Skip to content

Commit a866162

Browse files
committed
Skip failing test on HHVM and minor clean up
1 parent 89d8379 commit a866162

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: php
33
# lock distro so new future defaults will not break the build
44
dist: trusty
55

6-
matrix:
6+
jobs:
77
include:
88
- php: 5.3
99
dist: precise
@@ -16,12 +16,9 @@ matrix:
1616
- php: 7.3
1717
- php: 7.4
1818
- php: hhvm-3.18
19-
install: composer require phpunit/phpunit:^5 --dev --no-interaction # requires legacy phpunit
2019
allow_failures:
2120
- php: hhvm-3.18
2221

23-
sudo: false
24-
2522
install:
2623
- composer install --no-interaction
2724

tests/CallableStub.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/Query/TcpTransportExecutorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ function ($e) use (&$wait) {
247247

248248
public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneChunkWhenServerClosesSocket()
249249
{
250+
if (defined('HHVM_VERSION')) {
251+
$this->markTestSkipped('Not supported on HHVM');
252+
}
253+
250254
$writableCallback = null;
251255
$loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
252256
$loop->expects($this->once())->method('addWriteStream')->with($this->anything(), $this->callback(function ($cb) use (&$writableCallback) {

tests/TestCase.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ protected function expectCallableNever()
3939

4040
protected function createCallableMock()
4141
{
42-
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
42+
if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) {
43+
// PHPUnit 9+
44+
return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock();
45+
} else {
46+
// legacy PHPUnit 4 - PHPUnit 9
47+
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
48+
}
4349
}
4450

4551
public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null)

0 commit comments

Comments
 (0)