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 afb7e32..b5af1ba 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php @@ -190,7 +190,7 @@ function testMaintenanceModeLoginPaths() { $this->drupalGet('test-page'); $this->assertText($offline_message); $this->drupalGet('menu_login_callback'); - $this->assertText('This is menu_login_callback().', 'Maintenance mode can be bypassed using an event subscriber.'); + $this->assertText('This is TestControllers::testLogin.', 'Maintenance mode can be bypassed using an event subscriber.'); config('system.maintenance')->set('enabled', 0)->save(); } diff --git a/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/TestControllers.php b/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/TestControllers.php index 34d42f4..48c2da3 100644 --- a/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/TestControllers.php +++ b/core/modules/system/tests/modules/menu_test/lib/Drupal/menu_test/TestControllers.php @@ -15,6 +15,13 @@ class TestControllers { /** + * Returns page to be used as a login path. + */ + public function testLogin() { + return 'This is TestControllers::testLogin.'; + } + + /** * Prints out test data. */ public function test1() { diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module index b5c0c47..5b5cac6 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -314,8 +314,7 @@ function menu_test_menu() { // Test the access key with a function callback. $items['menu_login_callback'] = array( 'title' => 'Used as a login path', - 'page callback' => 'menu_login_callback', - 'access callback' => TRUE, + 'route_name' => 'menu_login_callback', ); // Test the access key. @@ -737,18 +736,6 @@ function menu_test_static_variable($value = NULL) { } /** - * Page callback: Provides a login path. - * - * @return string - * A text string that can be used for comparison. - * - * @see menu_test_menu(). - */ -function menu_login_callback() { - return 'This is menu_login_callback().'; -} - -/** * Title callback: Concatenates the title and case number. * * @param string $title diff --git a/core/modules/system/tests/modules/menu_test/menu_test.routing.yml b/core/modules/system/tests/modules/menu_test/menu_test.routing.yml index 3154626..f6b14ca 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.routing.yml +++ b/core/modules/system/tests/modules/menu_test/menu_test.routing.yml @@ -1,3 +1,9 @@ +menu_login_callback: + pattern: '/menu_login_callback' + defaults: + _content: '\Drupal\menu_test\TestControllers::testLogin' + requirements: + _access: 'TRUE' menu_router_test1: pattern: '/foo/{bar}' defaults: