public function testShouldAllowDispatchingPsr7Instances()
{
$handler = function ($req, $res, $next) {
return $res;
};
$next = function ($req, $res, $err) {
Assert::fail('Next was called; it should not have been');
};
$request = $this->prophesize(ServerRequestInterface::class);
$response = $this->prophesize(ResponseInterface::class);
$dispatch = new Dispatch();
$route = new Route('/foo', $handler);
$err = null;
$result = $dispatch($route, $err, $request->reveal(), $response->reveal(), $next);
$this->assertSame($response->reveal(), $result);
}