You are here

protected function LocalTaskManagerTest::setupLocalTaskManager in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::setupLocalTaskManager()

Setups the local task manager for the test.

6 calls to LocalTaskManagerTest::setupLocalTaskManager()
LocalTaskManagerTest::setUp in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
LocalTaskManagerTest::testGetLocalTaskForRouteWithEmptyCache in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the cache of the local task manager with an empty initial cache.
LocalTaskManagerTest::testGetLocalTaskForRouteWithFilledCache in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the cache of the local task manager with a filled initial cache.
LocalTaskManagerTest::testGetLocalTasksForRouteForChild in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the getLocalTasksForRoute method on a child.
LocalTaskManagerTest::testGetLocalTasksForRouteSingleLevelTitle in core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php
Tests the getLocalTasksForRoute method.

... See full list

File

core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php, line 256
Contains \Drupal\Tests\Core\Menu\LocalTaskManagerTest.

Class

LocalTaskManagerTest
@coversDefaultClass \Drupal\Core\Menu\LocalTaskManager @group Menu

Namespace

Drupal\Tests\Core\Menu

Code

protected function setupLocalTaskManager() {
  $request_stack = new RequestStack();
  $request_stack
    ->push($this->request);
  $module_handler = $this
    ->getMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $module_handler
    ->expects($this
    ->any())
    ->method('getModuleDirectories')
    ->willReturn(array());
  $language_manager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $language_manager
    ->expects($this
    ->any())
    ->method('getCurrentLanguage')
    ->will($this
    ->returnValue(new Language(array(
    'id' => 'en',
  ))));
  $this->manager = new LocalTaskManager($this->controllerResolver, $request_stack, $this->routeMatch, $this->routeProvider, $module_handler, $this->cacheBackend, $language_manager, $this->accessManager, $this->account);
  $property = new \ReflectionProperty('Drupal\\Core\\Menu\\LocalTaskManager', 'discovery');
  $property
    ->setAccessible(TRUE);
  $property
    ->setValue($this->manager, $this->pluginDiscovery);
  $property = new \ReflectionProperty('Drupal\\Core\\Menu\\LocalTaskManager', 'factory');
  $property
    ->setAccessible(TRUE);
  $property
    ->setValue($this->manager, $this->factory);
}