function LocalTaskManagerTest::testGetLocalTasksForRouteForChild
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::testGetLocalTasksForRouteForChild()
- 10 core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::testGetLocalTasksForRouteForChild()
- 11.x core/tests/Drupal/Tests/Core/Menu/LocalTaskManagerTest.php \Drupal\Tests\Core\Menu\LocalTaskManagerTest::testGetLocalTasksForRouteForChild()
Tests the getLocalTasksForRoute method on a child.
See also
\Drupal\system\Plugin\Type\MenuLocalTaskManager::getLocalTasksForRoute()
File
-
core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalTaskManagerTest.php, line 145
Class
- LocalTaskManagerTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Menu%21LocalTaskManager.php/class/LocalTaskManager/9" title="Provides the default local task manager using YML as primary definition." class="local">\Drupal\Core\Menu\LocalTaskManager</a> @group Menu
Namespace
Drupal\Tests\Core\MenuCode
public function testGetLocalTasksForRouteForChild() {
$definitions = $this->getLocalTaskFixtures();
$this->pluginDiscovery
->expects($this->once())
->method('getDefinitions')
->willReturn($definitions);
$mock_plugin = $this->createMock('Drupal\\Core\\Menu\\LocalTaskInterface');
$this->setupFactory($mock_plugin);
$this->setupLocalTaskManager();
$local_tasks = $this->manager
->getLocalTasksForRoute('menu_local_task_test_tasks_child1_page');
$result = $this->getLocalTasksForRouteResult($mock_plugin);
$this->assertEquals($result, $local_tasks);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.