function DisplayPageTest::testMenuLinks
Same name in other branches
- 8.9.x core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testMenuLinks()
- 10 core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testMenuLinks()
- 11.x core/modules/views/tests/src/Kernel/Plugin/DisplayPageTest.php \Drupal\Tests\views\Kernel\Plugin\DisplayPageTest::testMenuLinks()
Tests the generated menu links of views.
File
-
core/
modules/ views/ tests/ src/ Kernel/ Plugin/ DisplayPageTest.php, line 127
Class
- DisplayPageTest
- Tests the page display plugin.
Namespace
Drupal\Tests\views\Kernel\PluginCode
public function testMenuLinks() {
\Drupal::service('plugin.manager.menu.link')->rebuild();
$tree = \Drupal::menuTree()->load('admin', new MenuTreeParameters());
$this->assertTrue(isset($tree['system.admin']->subtree['views_view:views.test_page_display_menu.page_4']));
$menu_link = $tree['system.admin']->subtree['views_view:views.test_page_display_menu.page_4']->link;
$this->assertEquals('Test child (with parent)', $menu_link->getTitle());
$this->assertEquals(TRUE, $menu_link->isExpanded());
$this->assertEquals('Sample description.', $menu_link->getDescription());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.