You are here

protected function MenuRouterTest::doTestMenuOnRoute in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php \Drupal\Tests\system\Functional\Menu\MenuRouterTest::doTestMenuOnRoute()

Tests a menu on a router page.

1 call to MenuRouterTest::doTestMenuOnRoute()
MenuRouterTest::testMenuIntegration in core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
Tests menu integration.

File

core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php, line 179

Class

MenuRouterTest
Tests menu router and default menu link functionality.

Namespace

Drupal\Tests\system\Functional\Menu

Code

protected function doTestMenuOnRoute() {
  \Drupal::service('module_installer')
    ->install([
    'router_test',
  ]);
  \Drupal::service('router.builder')
    ->rebuild();
  $this
    ->resetAll();
  $this
    ->drupalGet('router_test/test2');
  $this
    ->assertLinkByHref('menu_no_title_callback');
  $this
    ->assertLinkByHref('menu-title-test/case1');
  $this
    ->assertLinkByHref('menu-title-test/case2');
  $this
    ->assertLinkByHref('menu-title-test/case3');
}