You are here

public function LocalTaskManagerTest::testGetLocalTasksForRouteSingleLevelTitle 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::testGetLocalTasksForRouteSingleLevelTitle()

Tests the getLocalTasksForRoute method.

See also

\Drupal\system\Plugin\Type\MenuLocalTaskManager::getLocalTasksForRoute()

File

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

Class

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

Namespace

Drupal\Tests\Core\Menu

Code

public function testGetLocalTasksForRouteSingleLevelTitle() {
  $definitions = $this
    ->getLocalTaskFixtures();
  $this->pluginDiscovery
    ->expects($this
    ->once())
    ->method('getDefinitions')
    ->will($this
    ->returnValue($definitions));
  $mock_plugin = $this
    ->getMock('Drupal\\Core\\Menu\\LocalTaskInterface');
  $this
    ->setupFactory($mock_plugin);
  $this
    ->setupLocalTaskManager();
  $local_tasks = $this->manager
    ->getLocalTasksForRoute('menu_local_task_test_tasks_view');
  $result = $this
    ->getLocalTasksForRouteResult($mock_plugin);
  $this
    ->assertEquals($result, $local_tasks);
}