function MenuRouterTestCase::testMenuItemTitlesCases

Tests the possible ways to set the title for menu items. Also tests that menu item titles work with string overrides.

File

drupal/modules/simpletest/tests/menu.test, line 583
Provides SimpleTests for menu.inc.

Class

MenuRouterTestCase

Code

function testMenuItemTitlesCases() {

  // Build array with string overrides.
  $test_data = array(
    1 => array(
      'Example title - Case 1' => 'Alternative example title - Case 1',
    ),
    2 => array(
      'Example @sub1 - Case @op2' => 'Alternative example @sub1 - Case @op2',
    ),
    3 => array(
      'Example title' => 'Alternative example title',
    ),
    4 => array(
      'Example title' => 'Alternative example title',
    ),
  );
  foreach ($test_data as $case_no => $override) {
    $this
      ->menuItemTitlesCasesHelper($case_no);
    variable_set('locale_custom_strings_en', array(
      '' => $override,
    ));
    $this
      ->menuItemTitlesCasesHelper($case_no, TRUE);
    variable_set('locale_custom_strings_en', array());
  }
}