private function MenuRouterTest::menuItemTitlesCasesHelper

Get a URL and assert the title given a case number. If override is true, the title is asserted to begin with "Alternative".

1 call to MenuRouterTest::menuItemTitlesCasesHelper()
MenuRouterTest::testMenuItemTitlesCases in drupal/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php
Tests the possible ways to set the title for menu items. Also tests that menu item titles work with string overrides.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php, line 552
Definition of Drupal\system\Tests\Menu\MenuRouterTest.

Class

MenuRouterTest
Tests menu router and hook_menu() functionality.

Namespace

Drupal\system\Tests\Menu

Code

private function menuItemTitlesCasesHelper($case_no, $override = FALSE) {
  $this
    ->drupalGet('menu-title-test/case' . $case_no);
  $this
    ->assertResponse(200);
  $asserted_title = $override ? 'Alternative example title - Case ' . $case_no : 'Example title - Case ' . $case_no;
  $this
    ->assertTitle($asserted_title . ' | Drupal', format_string('Menu title is: %title.', array(
    '%title' => $asserted_title,
  )), 'Menu');
}