diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php index 86d4740..3a6eda9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php @@ -61,27 +61,27 @@ function setUp() { * Tests menu integration. */ public function testMenuIntegration() { - $this->_testTitleMenuCallback(); - $this->_testMenuSetItem(); - $this->_testMenuOptionalPlaceholders(); - $this->_testMenuOnRoute(); - $this->_testMenuHidden(); - $this->_testMenuGetItemNoAncestors(); - $this->_testMenuName(); - $this->_testMenuItemTitlesCases(); - $this->_testMenuLinkMaintain(); - $this->_testMenuLinkOptions(); - $this->_testMenuLoadArgumentsInheritance(); - $this->_testMenuItemHooks(); - $this->_testDescriptionMenuItems(); - $this->_testHookMenuIntegration(); - $this->_testExoticPath(); + $this->doTestTitleMenuCallback(); + $this->doTestMenuSetItem(); + $this->doTestMenuOptionalPlaceholders(); + $this->doTestMenuOnRoute(); + $this->doTestMenuHidden(); + $this->doTestMenuGetItemNoAncestors(); + $this->doTestMenuName(); + $this->doTestMenuItemTitlesCases(); + $this->doTestMenuLinkMaintain(); + $this->doTestMenuLinkOptions(); + $this->doTestMenuLoadArgumentsInheritance(); + $this->doTestMenuItemHooks(); + $this->doTestDescriptionMenuItems(); + $this->doTestHookMenuIntegration(); + $this->doTestExoticPath(); } /** * Test local tasks with route placeholders. */ - protected function _testHookMenuIntegration() { + protected function doTestHookMenuIntegration() { // Generate base path with random argument. $base_path = 'foo/' . $this->randomName(8); $this->drupalGet($base_path); @@ -98,7 +98,7 @@ protected function _testHookMenuIntegration() { /** * Test title callback set to FALSE. */ - protected function _testTitleCallbackFalse() { + protected function doTestTitleCallbackFalse() { $this->drupalGet('test-page'); $this->assertText('A title with @placeholder', 'Raw text found on the page'); $this->assertNoText(t('A title with @placeholder', array('@placeholder' => 'some other text')), 'Text with placeholder substitutions not found.'); @@ -107,7 +107,7 @@ protected function _testTitleCallbackFalse() { /** * Tests page title of MENU_CALLBACKs. */ - protected function _testTitleMenuCallback() { + protected function doTestTitleMenuCallback() { // Verify that the menu router item title is not visible. $this->drupalGet(''); $this->assertNoText(t('Menu Callback Title')); @@ -119,7 +119,7 @@ protected function _testTitleMenuCallback() { /** * Tests menu item descriptions. */ - protected function _testDescriptionMenuItems() { + protected function doTestDescriptionMenuItems() { // Verify that the menu router item title is output as page title. $this->drupalGet('menu_callback_description'); $this->assertText(t('Menu item description text')); @@ -129,7 +129,7 @@ protected function _testDescriptionMenuItems() { /** * Tests for menu_link_maintain(). */ - protected function _testMenuLinkMaintain() { + protected function doTestMenuLinkMaintain() { $admin_user = $this->drupalCreateUser(array('access content', 'administer site configuration')); $this->drupalLogin($admin_user); @@ -175,7 +175,7 @@ protected function _testMenuLinkMaintain() { /** * Tests for menu_name parameter for hook_menu(). */ - protected function _testMenuName() { + protected function doTestMenuName() { $admin_user = $this->drupalCreateUser(array('administer site configuration')); $this->drupalLogin($admin_user); @@ -197,7 +197,7 @@ protected function _testMenuName() { /** * Tests for menu hierarchy. */ - protected function _testMenuHierarchy() { + protected function doTestMenuHierarchy() { $parent_links = entity_load_multiple_by_properties('menu_link', array('link_path' => 'menu-test/hierarchy/parent')); $parent_link = reset($parent_links); $child_links = entity_load_multiple_by_properties('menu_link', array('link_path' => 'menu-test/hierarchy/parent/child')); @@ -212,7 +212,7 @@ protected function _testMenuHierarchy() { /** * Tests menu link depth and parents of local tasks and menu callbacks. */ - protected function _testMenuHidden() { + protected function doTestMenuHidden() { // Verify links for one dynamic argument. $query = \Drupal::entityQuery('menu_link') ->condition('router_path', 'menu-test/hidden/menu', 'STARTS_WITH') @@ -309,7 +309,7 @@ protected function _testMenuHidden() { /** * Test menu_get_item() with empty ancestors. */ - protected function _testMenuGetItemNoAncestors() { + protected function doTestMenuGetItemNoAncestors() { \Drupal::state()->set('menu.masks', array()); $this->drupalGet(''); } @@ -317,7 +317,7 @@ protected function _testMenuGetItemNoAncestors() { /** * Test menu_set_item(). */ - protected function _testMenuSetItem() { + protected function doTestMenuSetItem() { $item = menu_get_item('test-page'); $this->assertEqual($item['path'], 'test-page', "Path from menu_get_item('test-page') is equal to 'test-page'", 'menu'); @@ -334,7 +334,7 @@ protected function _testMenuSetItem() { /** * Test menu maintenance hooks. */ - protected function _testMenuItemHooks() { + protected function doTestMenuItemHooks() { // Create an item. menu_link_maintain('menu_test', 'insert', 'menu_test_maintain/4', 'Menu link #4'); $this->assertEqual(menu_test_static_variable(), 'insert', 'hook_menu_link_insert() fired correctly'); @@ -349,7 +349,7 @@ protected function _testMenuItemHooks() { /** * Test menu link 'options' storage and rendering. */ - protected function _testMenuLinkOptions() { + protected function doTestMenuLinkOptions() { // Create a menu link with options. $menu_link = entity_create('menu_link', array( 'link_title' => 'Menu link options test', @@ -376,7 +376,7 @@ protected function _testMenuLinkOptions() { * Tests the possible ways to set the title for menu items. * Also tests that menu item titles work with string overrides. */ - protected function _testMenuItemTitlesCases() { + protected function doTestMenuItemTitlesCases() { // Build array with string overrides. $test_data = array( @@ -415,7 +415,7 @@ protected function menuLoadRouter($router_path) { /** * Tests inheritance of 'load arguments'. */ - protected function _testMenuLoadArgumentsInheritance() { + protected function doTestMenuLoadArgumentsInheritance() { $expected = array( 'menu-test/arguments/%/%' => array( 2 => array('menu_test_argument_load' => array(3)), @@ -466,7 +466,7 @@ protected function _testMenuLoadArgumentsInheritance() { /** * Test menu links that have optional placeholders. */ - protected function _testMenuOptionalPlaceholders() { + protected function doTestMenuOptionalPlaceholders() { $this->drupalGet('menu-test/optional'); $this->assertResponse(200); $this->assertText('Sometimes there is no placeholder.'); @@ -479,7 +479,7 @@ protected function _testMenuOptionalPlaceholders() { /** * Tests a menu on a router page. */ - protected function _testMenuOnRoute() { + protected function doTestMenuOnRoute() { \Drupal::moduleHandler()->install(array('router_test')); \Drupal::service('router.builder')->rebuild(); @@ -494,7 +494,7 @@ protected function _testMenuOnRoute() { /** * Test path containing "exotic" characters. */ - function _testExoticPath() { + protected function doTestExoticPath() { $path = "menu-test/ -._~!$'\"()*@[]?&+%#,;=:" . // "Special" ASCII characters. "%23%25%26%2B%2F%3F" . // Characters that look like a percent-escaped string. "éøïвβ中國書۞"; // Characters from various non-ASCII alphabets. @@ -541,28 +541,28 @@ public function testAuthUserUserLogin() { */ public function testThemeIntegration() { $this->initializeTestThemeConfiguration(); - $this->_testThemeCallbackMaintenanceMode(); + $this->doTestThemeCallbackMaintenanceMode(); $this->initializeTestThemeConfiguration(); - $this->_testThemeCallbackFakeTheme(); + $this->doTestThemeCallbackFakeTheme(); $this->initializeTestThemeConfiguration(); - $this->_testHookCustomTheme(); + $this->doTestHookCustomTheme(); $this->initializeTestThemeConfiguration(); - $this->_testThemeCallbackHookCustomTheme(); + $this->doTestThemeCallbackHookCustomTheme(); $this->initializeTestThemeConfiguration(); - $this->_testThemeCallbackAdministrative(); + $this->doTestThemeCallbackAdministrative(); $this->initializeTestThemeConfiguration(); - $this->_testThemeCallbackInheritance(); + $this->doTestThemeCallbackInheritance(); $this->initializeTestThemeConfiguration(); - $this->_testThemeCallbackNoThemeRequested(); + $this->doTestThemeCallbackNoThemeRequested(); $this->initializeTestThemeConfiguration(); - $this->_testThemeCallbackOptionalTheme(); + $this->doTestThemeCallbackOptionalTheme(); } /** @@ -583,7 +583,7 @@ protected function initializeTestThemeConfiguration() { /** * Test the theme callback when it is set to use an administrative theme. */ - protected function _testThemeCallbackAdministrative() { + protected function doTestThemeCallbackAdministrative() { theme_enable(array($this->admin_theme)); $this->drupalGet('menu-test/theme-callback/use-admin-theme'); $this->assertText('Custom theme: seven. Actual theme: seven.', 'The administrative theme can be correctly set in a theme callback.'); @@ -593,7 +593,7 @@ protected function _testThemeCallbackAdministrative() { /** * Test that the theme callback is properly inherited. */ - protected function _testThemeCallbackInheritance() { + protected function doTestThemeCallbackInheritance() { theme_enable(array($this->admin_theme)); $this->drupalGet('menu-test/theme-callback/use-admin-theme/inheritance'); $this->assertText('Custom theme: seven. Actual theme: seven. Theme callback inheritance is being tested.', 'Theme callback inheritance correctly uses the administrative theme.'); @@ -603,7 +603,7 @@ protected function _testThemeCallbackInheritance() { /** * Test the theme callback when the site is in maintenance mode. */ - protected function _testThemeCallbackMaintenanceMode() { + protected function doTestThemeCallbackMaintenanceMode() { $this->container->get('state')->set('system.maintenance_mode', TRUE); theme_enable(array($this->admin_theme)); @@ -625,7 +625,7 @@ protected function _testThemeCallbackMaintenanceMode() { /** * Test the theme callback when it is set to use an optional theme. */ - protected function _testThemeCallbackOptionalTheme() { + protected function doTestThemeCallbackOptionalTheme() { // Request a theme that is not enabled. $this->drupalGet('menu-test/theme-callback/use-stark-theme'); $this->assertText('Custom theme: NONE. Actual theme: bartik.', 'The theme callback system falls back on the default theme when a theme that is not enabled is requested.'); @@ -641,7 +641,7 @@ protected function _testThemeCallbackOptionalTheme() { /** * Test the theme callback when it is set to use a theme that does not exist. */ - protected function _testThemeCallbackFakeTheme() { + protected function doTestThemeCallbackFakeTheme() { $this->drupalGet('menu-test/theme-callback/use-fake-theme'); $this->assertText('Custom theme: NONE. Actual theme: bartik.', 'The theme callback system falls back on the default theme when a theme that does not exist is requested.'); $this->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page."); @@ -650,7 +650,7 @@ protected function _testThemeCallbackFakeTheme() { /** * Test the theme callback when no theme is requested. */ - protected function _testThemeCallbackNoThemeRequested() { + protected function doTestThemeCallbackNoThemeRequested() { $this->drupalGet('menu-test/theme-callback/no-theme-requested'); $this->assertText('Custom theme: NONE. Actual theme: bartik.', 'The theme callback system falls back on the default theme when no theme is requested.'); $this->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page."); @@ -659,7 +659,7 @@ protected function _testThemeCallbackNoThemeRequested() { /** * Test that hook_custom_theme() can control the theme of a page. */ - protected function _testHookCustomTheme() { + protected function doTestHookCustomTheme() { // Trigger hook_custom_theme() to dynamically request the Stark theme for // the requested page. \Drupal::state()->set('menu_test.hook_custom_theme_name', $this->alternate_theme); @@ -675,7 +675,7 @@ protected function _testHookCustomTheme() { /** * Test that the theme callback wins out over hook_custom_theme(). */ - protected function _testThemeCallbackHookCustomTheme() { + protected function doTestThemeCallbackHookCustomTheme() { // Trigger hook_custom_theme() to dynamically request the Stark theme for // the requested page. \Drupal::state()->set('menu_test.hook_custom_theme_name', $this->alternate_theme);