function MenuRouterTestCase::testMaintenanceModeLoginPaths

Make sure the maintenance mode can be bypassed using hook_menu_site_status_alter().

See also

hook_menu_site_status_alter().

File

modules/simpletest/tests/menu.test, line 226

Class

MenuRouterTestCase

Code

function testMaintenanceModeLoginPaths() {
    variable_set('maintenance_mode', TRUE);
    $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array(
        '@site' => variable_get('site_name', 'Drupal'),
    ));
    $this->drupalLogout();
    $this->drupalGet('node');
    $this->assertText($offline_message);
    $this->drupalGet('menu_login_callback');
    $this->assertText('This is menu_login_callback().', t('Maintenance mode can be bypassed through hook_login_paths().'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.