public function testRequestResponseStrategyRouteThrowsExceptionWhenWrongResponseReturned()
{
$this->setExpectedException('RuntimeException', 'When using the Request -> Response Strategy your controller must return an instance of [Orno\\Http\\ResponseInterface]');
$collection = new Route\RouteCollection();
$collection->setStrategy(Route\RouteStrategyInterface::REQUEST_RESPONSE_STRATEGY);
$collection->get('/route', function (Request $request, Response $response) {
$this->assertInstanceOf('Orno\\Http\\RequestInterface', $request);
$this->assertInstanceOf('Orno\\Http\\ResponseInterface', $response);
return [];
});
$dispatcher = $collection->getDispatcher();
$response = $dispatcher->dispatch('GET', '/route');
}