function MenuRouterTest::doTestTitleMenuCallback

Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php \Drupal\Tests\system\Functional\Menu\MenuRouterTest::doTestTitleMenuCallback()
  2. 10 core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php \Drupal\Tests\system\Functional\Menu\MenuRouterTest::doTestTitleMenuCallback()
  3. 11.x core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php \Drupal\Tests\system\Functional\Menu\MenuRouterTest::doTestTitleMenuCallback()

Tests page title of MENU_CALLBACKs.

1 call to MenuRouterTest::doTestTitleMenuCallback()
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 92

Class

MenuRouterTest
Tests menu router and default menu link functionality.

Namespace

Drupal\Tests\system\Functional\Menu

Code

protected function doTestTitleMenuCallback() {
    // Verify that the menu router item title is not visible.
    $this->drupalGet('');
    $this->assertSession()
        ->pageTextNotContains('Menu Callback Title');
    // Verify that the menu router item title is output as page title.
    $this->drupalGet('menu_callback_title');
    $this->assertSession()
        ->pageTextContains('Menu Callback Title');
}

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