From cc9d2fb465e41a684b4afd2b05494d144e9f28a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Wed, 9 Aug 2017 11:24:44 +0200 Subject: [PATCH] Fix failing tests for PHP 7.1 --- .travis.yml | 3 ++- tests/Query/ExecutorTest.php | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bb2d9a0..0867f801 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/tests/Query/ExecutorTest.php b/tests/Query/ExecutorTest.php index 20efd49b..2db3e976 100644 --- a/tests/Query/ExecutorTest.php +++ b/tests/Query/ExecutorTest.php @@ -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 */ @@ -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 */ @@ -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 */ @@ -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 */ @@ -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 @@ -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 */ @@ -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; };