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

Fix failing tests for PHP 7.1 #72

Merged
merged 1 commit into from
Aug 9, 2017
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ php:
- 5.4
- 5.5
- 5.6
- 7
- 7.0
- 7.1
- hhvm # ignore errors, see below

# lock distro so new future defaults will not break the build
Expand Down
15 changes: 8 additions & 7 deletions tests/Query/ExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function queryShouldCreateUdpRequest()
->will($this->returnNewConnectionMock(false));

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451);
$this->executor->query('8.8.8.8:53', $query, function () {}, function () {});
$this->executor->query('8.8.8.8:53', $query);
}

/** @test */
Expand All @@ -62,7 +62,7 @@ public function resolveShouldCreateTcpRequestIfRequestIsLargerThan512Bytes()
->will($this->returnNewConnectionMock(false));

$query = new Query(str_repeat('a', 512).'.igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451);
$this->executor->query('8.8.8.8:53', $query, function () {}, function () {});
$this->executor->query('8.8.8.8:53', $query);
}

/** @test */
Expand Down Expand Up @@ -160,7 +160,7 @@ public function resolveShouldRetryWithTcpIfResponseIsTruncated()
->will($this->returnNewConnectionMock());

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451);
$this->executor->query('8.8.8.8:53', $query, function () {}, function () {});
$this->executor->query('8.8.8.8:53', $query);
}

/** @test */
Expand Down Expand Up @@ -191,7 +191,7 @@ public function resolveShouldRetryWithTcpIfUdpThrows()
->will($this->returnNewConnectionMock());

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451);
$this->executor->query('8.8.8.8:53', $query, function () {}, function () {});
$this->executor->query('8.8.8.8:53', $query);
}

/** @test */
Expand Down Expand Up @@ -221,7 +221,7 @@ public function resolveShouldFailIfBothUdpAndTcpThrow()
->will($this->throwException(new \Exception()));

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451);
$promise = $this->executor->query('8.8.8.8:53', $query, function () {}, function () {});
$promise = $this->executor->query('8.8.8.8:53', $query);

$mock = $this->createCallableMock();
$mock
Expand Down Expand Up @@ -303,7 +303,7 @@ public function resolveShouldCancelTimerWhenFullResponseIsReceived()
->with($timer);

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451);
$this->executor->query('8.8.8.8:53', $query, function () {}, function () {});
$this->executor->query('8.8.8.8:53', $query);
}

/** @test */
Expand Down Expand Up @@ -351,7 +351,8 @@ public function resolveShouldCloseConnectionOnTimeout()
private function returnStandardResponse()
{
$that = $this;
$callback = function ($data, $response) use ($that) {
$callback = function ($data) use ($that) {
$response = new Message();
$that->convertMessageToStandardResponse($response);
return $response;
};
Expand Down