function LocalActionManagerTest::testControllerResolverDeprecation

@expectedDeprecation Using the 'controller_resolver' service as the first argument is deprecated, use the 'http_kernel.controller.argument_resolver' instead. If your subclass requires the 'controller_resolver' service add it as an additional argument. See https://www.drupal.org/node/2959408. @group legacy

File

core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php, line 388

Class

LocalActionManagerTest
@coversDefaultClass \Drupal\Core\Menu\LocalActionManager @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

public function testControllerResolverDeprecation() {
    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.");
    }
    $controller_resolver = $this->getMockBuilder(ControllerResolver::class)
        ->disableOriginalConstructor()
        ->getMock();
    $route_match = $this->createMock('Drupal\\Core\\Routing\\RouteMatchInterface');
    $request_stack = new RequestStack();
    $request_stack->push($this->request);
    $module_handler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
    $module_handler->expects($this->any())
        ->method('getModuleDirectories')
        ->willReturn([]);
    $language_manager = $this->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
    $language_manager->expects($this->any())
        ->method('getCurrentLanguage')
        ->will($this->returnValue(new Language([
        'id' => 'en',
    ])));
    new LocalTaskManager($controller_resolver, $request_stack, $route_match, $this->routeProvider, $this->moduleHandler, $this->cacheBackend, $language_manager, $this->accessManager, $this->account);
}

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