Skip to content

Commit 44dadbb

Browse files
authored
Merge pull request #72 from clue-labs/php71
Fix failing tests for PHP 7.1
2 parents af11e3c + cc9d2fb commit 44dadbb

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ php:
55
- 5.4
66
- 5.5
77
- 5.6
8-
- 7
8+
- 7.0
9+
- 7.1
910
- hhvm # ignore errors, see below
1011

1112
# lock distro so new future defaults will not break the build

tests/Query/ExecutorTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function queryShouldCreateUdpRequest()
4242
->will($this->returnNewConnectionMock(false));
4343

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

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

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

6868
/** @test */
@@ -160,7 +160,7 @@ public function resolveShouldRetryWithTcpIfResponseIsTruncated()
160160
->will($this->returnNewConnectionMock());
161161

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

166166
/** @test */
@@ -191,7 +191,7 @@ public function resolveShouldRetryWithTcpIfUdpThrows()
191191
->will($this->returnNewConnectionMock());
192192

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

197197
/** @test */
@@ -221,7 +221,7 @@ public function resolveShouldFailIfBothUdpAndTcpThrow()
221221
->will($this->throwException(new \Exception()));
222222

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

226226
$mock = $this->createCallableMock();
227227
$mock
@@ -303,7 +303,7 @@ public function resolveShouldCancelTimerWhenFullResponseIsReceived()
303303
->with($timer);
304304

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

309309
/** @test */
@@ -351,7 +351,8 @@ public function resolveShouldCloseConnectionOnTimeout()
351351
private function returnStandardResponse()
352352
{
353353
$that = $this;
354-
$callback = function ($data, $response) use ($that) {
354+
$callback = function ($data) use ($that) {
355+
$response = new Message();
355356
$that->convertMessageToStandardResponse($response);
356357
return $response;
357358
};

0 commit comments

Comments
 (0)