ZendTest\Stratigility\DispatchTest::testProcessRaisesExceptionForNonInteropHandlersWhenNotProvidedAServerRequest PHP Method

testProcessRaisesExceptionForNonInteropHandlersWhenNotProvidedAServerRequest() public method

    public function testProcessRaisesExceptionForNonInteropHandlersWhenNotProvidedAServerRequest()
    {
        $request = $this->prophesize(RequestInterface::class)->reveal();
        $handler = function ($req, $res, $next) use(&$triggered) {
            Assert::fail('Handler was called; it should not have been');
        };
        $next = function ($req, $res, $err) {
            Assert::fail('Next was called; it should not have been');
        };
        $route = new Route('/foo', $handler);
        $dispatch = new Dispatch();
        $dispatch->setResponsePrototype($this->response->reveal());
        $this->setExpectedException(Exception\InvalidRequestTypeException::class);
        $dispatch->process($route, $request, $next);
    }
DispatchTest