function MenuRouterTest::doTestMenuOnRoute

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php \Drupal\Tests\system\Functional\Menu\MenuRouterTest::doTestMenuOnRoute()
  2. 8.9.x core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php \Drupal\Tests\system\Functional\Menu\MenuRouterTest::doTestMenuOnRoute()
  3. 11.x 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 181

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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.