ZendTest\Stratigility\FinalHandlerTest::testShouldNotDecoratePsrResponseAsStratigilityCompletedResponseWhenCreating404s PHP Method

testShouldNotDecoratePsrResponseAsStratigilityCompletedResponseWhenCreating404s() public method

    public function testShouldNotDecoratePsrResponseAsStratigilityCompletedResponseWhenCreating404s()
    {
        $response = new PsrResponse();
        $request = $this->prophesize('Zend\\Diactoros\\ServerRequest');
        $request->getAttribute('originalRequest', false)->willReturn(false);
        $request->getUri()->willReturn('/foo');
        $request->getMethod()->willReturn('GET');
        $final = new FinalHandler([], $response);
        $test = $final($request->reveal(), $response);
        $this->assertInstanceOf(ResponseInterface::class, $test);
        $this->assertSame(404, $test->getStatusCode());
        $body = $test->getBody();
        $body->rewind();
        $this->assertContains('Cannot GET /foo', $body->getContents());
    }
FinalHandlerTest