public function testRestfulStrategyReturnsJsonResponseWhenHttpExceptionIsThrown()
{
$controller = $this->getMock('SomeClass', ['someMethod']);
$controller->expects($this->once())->method('someMethod')->will($this->throwException(new HttpException\ConflictException()));
$container = $this->getMock('Orno\\Di\\Container');
$container->expects($this->at(1))->method('get')->with($this->equalTo('SomeClass'))->will($this->returnValue($controller));
$collection = new Route\RouteCollection($container);
$collection->setStrategy(Route\RouteStrategyInterface::RESTFUL_STRATEGY);
$collection->get('/route', 'SomeClass::someMethod');
$dispatcher = $collection->getDispatcher();
$response = $dispatcher->dispatch('GET', '/route');
$this->assertInstanceOf('Orno\\Http\\JsonResponse', $response);
$this->assertSame(409, $response->getStatusCode());
$this->assertSame('{"status_code":409,"message":"Conflict"}', $response->getContent());
}