ZendTest\Stratigility\DispatchTest::testReturnsValueFromNonErrorHandler PHP Method

testReturnsValueFromNonErrorHandler() public method

    public function testReturnsValueFromNonErrorHandler()
    {
        $handler = function ($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 = null;
        $result = $dispatch($route, $err, $this->request->reveal(), $this->response->reveal(), $next);
        $this->assertSame($this->response->reveal(), $result);
    }
DispatchTest