Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
PHP 5.4 support in tests
Browse files Browse the repository at this point in the history
*sigh*
  • Loading branch information
weierophinney committed Mar 24, 2016
1 parent 86bcaba commit 60493e2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/FinalHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function testShouldNotMarkStratigilityResponseAsCompleteWhenHandlingError
{
$error = new Exception('Exception message', 501);

$response = $this->prophesize(Response::class);
$response = $this->prophesize('Zend\Stratigility\Http\Response');
$response->getStatusCode()->willReturn(200);
$response->withStatus(501, '')->will(function () use ($response) {
return $response->reveal();
Expand All @@ -258,7 +258,7 @@ public function testShouldNotMarkStratigilityResponseAsCompleteWhenHandlingError

$final = new FinalHandler([], new Response(new PsrResponse()));
$this->assertSame($response->reveal(), $final(
$this->prophesize(Request::class)->reveal(),
$this->prophesize('Zend\Stratigility\Http\Request')->reveal(),
$response->reveal(),
$error
));
Expand All @@ -276,12 +276,12 @@ public function testShouldNotDecoratePsrResponseAsStratigilityCompletedResponseW

$final = new FinalHandler([], new Response(new PsrResponse()));
$test = $final(
$this->prophesize(Request::class)->reveal(),
$this->prophesize('Zend\Stratigility\Http\Request')->reveal(),
$response,
$error
);

$this->assertInstanceOf(Response::class, $test);
$this->assertInstanceOf('Zend\Stratigility\Http\Response', $test);
$this->assertSame(501, $test->getStatusCode());
$this->assertSame('Not Implemented', $test->getReasonPhrase());

Expand All @@ -295,10 +295,10 @@ public function testShouldNotDecoratePsrResponseAsStratigilityCompletedResponseW
*/
public function testShouldNotMarkStratigilityResponseAsCompleteWhenCreating404s()
{
$body = $this->prophesize(StreamInterface::class);
$body = $this->prophesize('Psr\Http\Message\StreamInterface');
$body->getSize()->willReturn(0)->shouldBeCalledTimes(2);

$response = $this->prophesize(Response::class);
$response = $this->prophesize('Zend\Stratigility\Http\Response');
$response->getBody()->will(function () use ($body) {
return $body->reveal();
});
Expand All @@ -312,7 +312,7 @@ public function testShouldNotMarkStratigilityResponseAsCompleteWhenCreating404s(
})
->shouldBeCalled();

$request = $this->prophesize(PsrRequest::class);
$request = $this->prophesize('Zend\Diactoros\ServerRequest');
$request->getUri()->willReturn('/foo');
$request->getMethod()->willReturn('GET');

Expand All @@ -330,7 +330,7 @@ public function testShouldNotDecoratePsrResponseAsStratigilityCompletedResponseW
{
$response = new PsrResponse();

$request = $this->prophesize(PsrRequest::class);
$request = $this->prophesize('Zend\Diactoros\ServerRequest');
$request->getUri()->willReturn('/foo');
$request->getMethod()->willReturn('GET');

Expand All @@ -339,7 +339,7 @@ public function testShouldNotDecoratePsrResponseAsStratigilityCompletedResponseW
$request->reveal(),
$response
);
$this->assertInstanceOf(Response::class, $test);
$this->assertInstanceOf('Zend\Stratigility\Http\Response', $test);
$this->assertSame(404, $test->getStatusCode());

$body = $test->getBody();
Expand Down

0 comments on commit 60493e2

Please sign in to comment.