You are here

protected function MenuRouterTest::doTestMenuOnRoute in Drupal 9

Same name and namespace in other branches
  1. 8 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 178

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',
  ]);
  $this
    ->resetAll();
  $this
    ->drupalGet('router_test/test2');
  $this
    ->assertSession()
    ->linkByHrefExists('menu_no_title_callback');
  $this
    ->assertSession()
    ->linkByHrefExists('menu-title-test/case1');
  $this
    ->assertSession()
    ->linkByHrefExists('menu-title-test/case2');
  $this
    ->assertSession()
    ->linkByHrefExists('menu-title-test/case3');
}