diff --git a/tests/Io/TransactionTest.php b/tests/Io/TransactionTest.php index 371fc74..c1f608c 100644 --- a/tests/Io/TransactionTest.php +++ b/tests/Io/TransactionTest.php @@ -1,16 +1,16 @@ request('GET', 'http://example.com'); $response = $messageFactory->response(1.0, 333, null, array('Location' => 'foo')); - $requestRedirected = $messageFactory->request('GET', 'http://example.com/foo'); $sender = $this->makeSenderMock(); - $sender->expects($this->exactly(2))->method('send')->withConsecutive($requestOriginal, $requestRedirected)->willReturnOnConsecutiveCalls( + $sender->expects($this->exactly(2))->method('send')->withConsecutive( + array($requestOriginal), + array($this->callback(function (RequestInterface $request) { + return $request->getMethod() === 'GET' && (string)$request->getUri() === 'http://example.com/foo'; + })) + )->willReturnOnConsecutiveCalls( Promise\resolve($response), new \React\Promise\Promise(function () { }) );