Commit 35ab9aef authored by alexpott's avatar alexpott
Browse files

Issue #1987734 by InternetDevels, ramlev, juampy: Convert...

Issue #1987734 by InternetDevels, ramlev, juampy: Convert menu_login_callback() to a new style controller.
parent 1cb65032
......@@ -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();
}
......
......@@ -14,6 +14,13 @@
*/
class TestControllers {
/**
* Returns page to be used as a login path.
*/
public function testLogin() {
return 'This is TestControllers::testLogin.';
}
/**
* Prints out test data.
*/
......
......@@ -311,13 +311,6 @@ function menu_test_menu() {
'access arguments' => array('access content'),
);
// 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,
);
// Test the access key.
$items['menu-title-test/case1'] = array(
'title' => 'Example title - Case 1',
......@@ -726,18 +719,6 @@ function menu_test_static_variable($value = NULL) {
return $variable;
}
/**
* 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.
*
......
menu_login_callback:
pattern: '/menu_login_callback'
defaults:
_content: '\Drupal\menu_test\TestControllers::testLogin'
requirements:
_access: 'TRUE'
menu_router_test1:
pattern: '/foo/{bar}'
defaults:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment