public function testCallingProcessWithCallableMiddlewareDispatchesIt()
{
$next = $this->prophesize(Next::class);
$request = $this->prophesize(ServerRequestInterface::class)->reveal();
$response = $this->prophesize(ResponseInterface::class)->reveal();
$middleware = function ($req, $res, $next) use($response) {
return $response;
};
$route = new Route('/foo', $middleware);
$dispatch = new Dispatch();
$dispatch->setResponsePrototype($this->response->reveal());
$this->assertSame($response, $dispatch->process($route, $request, $next->reveal()));
}