ZendTest\Stratigility\DispatchTest::testThrowingExceptionInErrorHandlerTriggersNextWithException PHP Method

testThrowingExceptionInErrorHandlerTriggersNextWithException() public method

    public function testThrowingExceptionInErrorHandlerTriggersNextWithException()
    {
        $exception = new RuntimeException();
        $triggered = null;
        $handler = function ($err, $req, $res, $next) use($exception) {
            throw $exception;
        };
        $next = function ($req, $res, $err) use(&$triggered) {
            $triggered = $err;
        };
        $route = new Route('/foo', $handler);
        $dispatch = new Dispatch();
        $err = (object) ['error' => true];
        $dispatch($route, $err, $this->request->reveal(), $this->response->reveal(), $next);
        $this->assertSame($exception, $triggered);
    }
DispatchTest