You are here

function UpdateScriptTest::testMaintenanceModeUpdateFunctionality in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Update/UpdateScriptTest.php \Drupal\system\Tests\Update\UpdateScriptTest::testMaintenanceModeUpdateFunctionality()

Tests update.php while in maintenance mode.

File

core/modules/system/src/Tests/Update/UpdateScriptTest.php, line 209
Contains \Drupal\system\Tests\Update\UpdateScriptTest.

Class

UpdateScriptTest
Tests the update script access and functionality.

Namespace

Drupal\system\Tests\Update

Code

function testMaintenanceModeUpdateFunctionality() {
  $this->container
    ->get('state')
    ->set('system.maintenance_mode', TRUE);
  $initial_maintenance_mode = $this->container
    ->get('state')
    ->get('system.maintenance_mode');
  $this
    ->assertTrue($initial_maintenance_mode, 'Site is in maintenance mode.');
  $this
    ->updateScriptTest($initial_maintenance_mode);
  $final_maintenance_mode = $this->container
    ->get('state')
    ->get('system.maintenance_mode');
  $this
    ->assertEqual($final_maintenance_mode, $initial_maintenance_mode, 'Maintenance mode should not have changed after database updates.');
}