You are here

public function Maintenance200SettingsTest::testTurnOffSettings in Maintenance 200 8

Test toggling setting.

File

tests/src/Functional/Maintenance200SettingsTest.php, line 77

Class

Maintenance200SettingsTest
Test maintenance 200 settings.

Namespace

Drupal\Tests\maintenance200\Functional

Code

public function testTurnOffSettings() {

  // Turn on maintenance mode.
  $this
    ->drupalGet(Url::fromRoute('maintenance200_settings'));
  $edit = [
    'maintenance200_enabled' => 0,
  ];
  $this
    ->drupalPostForm('admin/config/development/maintenance200', $edit, t('Save configuration'));
  $this
    ->assertRaw('The configuration options have been saved.', 'Settings saved.');
  $this
    ->drupalGet(Url::fromRoute('maintenance200_settings'));
  $this
    ->assertFieldByName('maintenance200_enabled', FALSE);
}