function LocalTaskManagerTest::getLocalTasksForRouteResult

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::getLocalTasksForRouteResult()
  2. 8.9.x core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::getLocalTasksForRouteResult()
  3. 11.x core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::getLocalTasksForRouteResult()

Returns an expected result for getLocalTasksForRoute.

Parameters

\PHPUnit\Framework\MockObject\MockObject $mock_plugin: The mock plugin.

Return value

array The expected result, keyed by local task level.

4 calls to LocalTaskManagerTest::getLocalTasksForRouteResult()
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.

File

core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php, line 346

Class

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

Namespace

Drupal\Tests\Core\Menu

Code

protected function getLocalTasksForRouteResult($mock_plugin) {
    $result = [
        0 => [
            'menu_local_task_test_tasks_settings' => $mock_plugin,
            'menu_local_task_test_tasks_view.tab' => $mock_plugin,
            'menu_local_task_test_tasks_edit' => $mock_plugin,
        ],
        1 => [
            'menu_local_task_test_tasks_view_child1' => $mock_plugin,
            'menu_local_task_test_tasks_view_child2' => $mock_plugin,
        ],
    ];
    return $result;
}

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