Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor test improvements to support upcoming PHP 8 #168

Merged
merged 1 commit into from
Sep 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions tests/Query/TcpTransportExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ function ($e) use (&$wait) {

public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneChunkWhenServerClosesSocket()
{
if (defined('HHVM_VERSION')) {
$this->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) {
Expand All @@ -268,7 +264,10 @@ public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneCh

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

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

$client = stream_socket_accept($server);
fclose($client);
Expand Down Expand Up @@ -571,11 +570,7 @@ public function testQueryRejectsIfSocketIsClosedAfterPreviousQueryThatWasStillPe

$executor->handleWritable();

// manually close socket before processing second write
$ref = new \ReflectionProperty($executor, 'socket');
$ref->setAccessible(true);
$socket = $ref->getValue($executor);
fclose($socket);
// close client socket before processing second write
fclose($client);

$promise2 = $executor->query($query);
Expand Down