function ControllerResolverTest::testGetArgumentsWithRouteMatchAndRequest

Tests getArguments with a route match and a request.

@covers ::doGetArguments

@group legacy

File

core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php, line 237

Class

ControllerResolverTest
@coversDefaultClass \Drupal\Core\Controller\ControllerResolver @group Controller

Namespace

Drupal\Tests\Core\Controller

Code

public function testGetArgumentsWithRouteMatchAndRequest() {
    if (!in_array('Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolverInterface', class_implements('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver'))) {
        $this->markTestSkipped("Do not test ::getArguments() method when it is not implemented by Symfony's ControllerResolver.");
    }
    $request = Request::create('/test');
    $mock_controller = new MockController();
    $arguments = $this->controllerResolver
        ->getArguments($request, [
        $mock_controller,
        'getControllerWithRequestAndRouteMatch',
    ]);
    $this->assertEquals([
        RouteMatch::createFromRequest($request),
        $request,
    ], $arguments);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.