OrnoTest\Route\DispatcherTest::testUriStrategyRouteThrowsExceptionWhenResponseCannotBeBuilt PHP Method

testUriStrategyRouteThrowsExceptionWhenResponseCannotBeBuilt() public method

Assert that a route using the URI Strategy throws exception when Response cannot be built
    public function testUriStrategyRouteThrowsExceptionWhenResponseCannotBeBuilt()
    {
        $this->setExpectedException('RuntimeException', 'Unable to build Response from controller return value');
        $collection = new Route\RouteCollection();
        $collection->setStrategy(Route\RouteStrategyInterface::URI_STRATEGY);
        $collection->get('/route/{id}/{name}', function ($id, $name) {
            $this->assertEquals('2', $id);
            $this->assertEquals('phil', $name);
            return new \stdClass();
        });
        $dispatcher = $collection->getDispatcher();
        $response = $dispatcher->dispatch('GET', '/route/2/phil');
    }