OrnoTest\Route\DispatcherTest::testRestfulStrategyRouteReturnsResponseWhenControllerDoes PHP Method

testRestfulStrategyRouteReturnsResponseWhenControllerDoes() public method

Assert that a route using the Restful Strategy returns response when controller does
    public function testRestfulStrategyRouteReturnsResponseWhenControllerDoes()
    {
        $mockResponse = $this->getMock('Orno\\Http\\JsonResponse');
        $collection = new Route\RouteCollection();
        $collection->setStrategy(Route\RouteStrategyInterface::RESTFUL_STRATEGY);
        $collection->get('/route/{id}/{name}', function (Request $request) use($mockResponse) {
            $this->assertInstanceOf('Orno\\Http\\RequestInterface', $request);
            return $mockResponse;
        });
        $dispatcher = $collection->getDispatcher();
        $response = $dispatcher->dispatch('GET', '/route/2/phil');
        $this->assertSame($mockResponse, $response);
    }