OrnoTest\Route\DispatcherTest::testMethodArgumentStrategyRouteThrowsExceptionWhenResponseCannotBeBuilt PHP Méthode

testMethodArgumentStrategyRouteThrowsExceptionWhenResponseCannotBeBuilt() public méthode

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