You are here

protected function LocalTaskManagerTest::getLocalTasksCache 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::getLocalTasksCache()

Returns the cache entry expected when running getLocalTaskForRoute().

Return value

array

2 calls to LocalTaskManagerTest::getLocalTasksCache()
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.

File

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

Class

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

Namespace

Drupal\Tests\Core\Menu

Code

protected function getLocalTasksCache() {
  $local_task_fixtures = $this
    ->getLocalTaskFixtures();
  $local_tasks = array(
    'base_routes' => array(
      'menu_local_task_test_tasks_view' => 'menu_local_task_test_tasks_view',
    ),
    'parents' => array(
      'menu_local_task_test_tasks_view.tab' => TRUE,
    ),
    'children' => array(
      '> menu_local_task_test_tasks_view' => array(
        'menu_local_task_test_tasks_settings' => $local_task_fixtures['menu_local_task_test_tasks_settings'],
        'menu_local_task_test_tasks_edit' => $local_task_fixtures['menu_local_task_test_tasks_edit'],
        'menu_local_task_test_tasks_view.tab' => $local_task_fixtures['menu_local_task_test_tasks_view.tab'],
      ),
      'menu_local_task_test_tasks_view.tab' => array(
        // The manager will fill in the base_route before caching.
        'menu_local_task_test_tasks_view_child1' => array(
          'base_route' => 'menu_local_task_test_tasks_view',
        ) + $local_task_fixtures['menu_local_task_test_tasks_view_child1'],
        'menu_local_task_test_tasks_view_child2' => array(
          'base_route' => 'menu_local_task_test_tasks_view',
        ) + $local_task_fixtures['menu_local_task_test_tasks_view_child2'],
      ),
    ),
  );
  $local_tasks['children']['> menu_local_task_test_tasks_view']['menu_local_task_test_tasks_settings']['weight'] = 0;
  $local_tasks['children']['> menu_local_task_test_tasks_view']['menu_local_task_test_tasks_edit']['weight'] = 20 + 1.0E-6;
  $local_tasks['children']['> menu_local_task_test_tasks_view']['menu_local_task_test_tasks_view.tab']['weight'] = 2.0E-6;
  $local_tasks['children']['menu_local_task_test_tasks_view.tab']['menu_local_task_test_tasks_view_child1']['weight'] = 3.0E-6;
  $local_tasks['children']['menu_local_task_test_tasks_view.tab']['menu_local_task_test_tasks_view_child2']['weight'] = 4.0E-6;
  return $local_tasks;
}