Skip to content

Commit 4451d67

Browse files
committed
Fix test http layer
1 parent 0f7ba15 commit 4451d67

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

tests/Geocoder/Tests/CachedResponseAdapter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ protected function doSend(InternalRequestInterface $internalRequest)
4343
$content = unserialize(file_get_contents($file));
4444
$body = new StringStream($content);
4545

46-
$response = $this->adapter->getConfiguration()->getMessageFactory()->createResponse();
47-
$response->setBody($body);
46+
$response = $this->adapter->getConfiguration()->getMessageFactory()->createResponse(
47+
200,
48+
'OK',
49+
'1.1',
50+
[],
51+
$body
52+
);
4853

4954
if (!empty($content)) {
5055
return $response;

tests/Geocoder/Tests/TestCase.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ protected function getMockAdapter($expects = null)
2121
$expects = $this->once();
2222
}
2323

24-
$response = $this->getMock('Psr\Http\Message\ResponseInterface');
24+
$response = $this->getMock('Psr\Http\Message\MessageInterface');
25+
$response
26+
->expects($expects)
27+
->method('getBody')
28+
->will($this->returnValue(
29+
$this->getMock('Psr\Http\Message\StreamableInterface')
30+
));
2531

2632
$adapter = $this->getMock('Ivory\HttpAdapter\HttpAdapterInterface');
2733
$adapter
@@ -44,7 +50,7 @@ protected function getMockAdapterReturns($returnValue)
4450
->method('__toString')
4551
->will($this->returnValue((string) $returnValue));
4652

47-
$response = $this->getMock('Psr\Http\Message\ResponseInterface');
53+
$response = $this->getMock('Psr\Http\Message\MessageInterface');
4854
$response
4955
->expects($this->once())
5056
->method('getBody')

0 commit comments

Comments
 (0)