Skip to content

Commit 298ab53

Browse files
committed
Minor test improvements to support upcoming PHP 8
1 parent d45bad8 commit 298ab53

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

tests/Query/TcpTransportExecutorTest.php

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

248248
public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneChunkWhenServerClosesSocket()
249249
{
250-
if (defined('HHVM_VERSION')) {
251-
$this->markTestSkipped('Not supported on HHVM');
252-
}
253-
254250
$writableCallback = null;
255251
$loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
256252
$loop->expects($this->once())->method('addWriteStream')->with($this->anything(), $this->callback(function ($cb) use (&$writableCallback) {
@@ -268,7 +264,10 @@ public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneCh
268264

269265
$query = new Query('google' . str_repeat('.com', 10000), Message::TYPE_A, Message::CLASS_IN);
270266

271-
$promise = $executor->query($query);
267+
// send a bunch of queries and keep reference to last promise
268+
for ($i = 0; $i < 100; ++$i) {
269+
$promise = $executor->query($query);
270+
}
272271

273272
$client = stream_socket_accept($server);
274273
fclose($client);
@@ -571,11 +570,7 @@ public function testQueryRejectsIfSocketIsClosedAfterPreviousQueryThatWasStillPe
571570

572571
$executor->handleWritable();
573572

574-
// manually close socket before processing second write
575-
$ref = new \ReflectionProperty($executor, 'socket');
576-
$ref->setAccessible(true);
577-
$socket = $ref->getValue($executor);
578-
fclose($socket);
573+
// close client socket before processing second write
579574
fclose($client);
580575

581576
$promise2 = $executor->query($query);

0 commit comments

Comments
 (0)