ZendTest\Stratigility\DispatchTest::testIfErrorHandlerReturnsResponseDispatchReturnsTheResponse PHP Method

testIfErrorHandlerReturnsResponseDispatchReturnsTheResponse() public method

    public function testIfErrorHandlerReturnsResponseDispatchReturnsTheResponse()
    {
        $handler = function ($err, $req, $res, $next) {
            return $res;
        };
        $next = function ($req, $res, $err) {
            Assert::fail('Next was called; it should not have been');
        };
        $route = new Route('/foo', $handler);
        $dispatch = new Dispatch();
        $err = (object) ['error' => true];
        $result = $dispatch($route, $err, $this->request->reveal(), $this->response->reveal(), $next);
        $this->assertSame($this->response->reveal(), $result);
    }
DispatchTest