You are here

public function TestLocalActionManager::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php \Drupal\Tests\Core\Menu\TestLocalActionManager::__construct()
  2. 10 core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php \Drupal\Tests\Core\Menu\TestLocalActionManager::__construct()

Constructs a LocalActionManager object.

Parameters

\Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface $argument_resolver: An object to use in resolving route arguments.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

\Drupal\Core\Routing\RouteProviderInterface $route_provider: The route provider.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\Core\Access\AccessManagerInterface $access_manager: The access manager.

\Drupal\Core\Session\AccountInterface $account: The current user.

Overrides LocalActionManager::__construct

File

core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php, line 385
Contains \Drupal\Tests\Core\Menu\LocalActionManagerTest.

Class

TestLocalActionManager

Namespace

Drupal\Tests\Core\Menu

Code

public function __construct(ArgumentResolverInterface $argument_resolver, Request $request, RouteMatchInterface $route_match, RouteProviderInterface $route_provider, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, AccessManagerInterface $access_manager, AccountInterface $account, DiscoveryInterface $discovery, FactoryInterface $factory) {
  $this->discovery = $discovery;
  $this->factory = $factory;
  $this->routeProvider = $route_provider;
  $this->accessManager = $access_manager;
  $this->account = $account;
  $this->argumentResolver = $argument_resolver;
  $this->requestStack = new RequestStack();
  $this->requestStack
    ->push($request);
  $this->routeMatch = $route_match;
  $this->moduleHandler = $module_handler;
  $this
    ->alterInfo('menu_local_actions');
  $this
    ->setCacheBackend($cache_backend, 'local_action_plugins', [
    'local_action',
  ]);
}