You are here

public function MaintenanceModeTest::testMaintenanceModeCheck in Nagios Monitoring 8

File

tests/src/Kernel/MaintenanceModeTest.php, line 77

Class

MaintenanceModeTest
Tests the functionality to monitor cron.

Namespace

Drupal\Tests\nagios\Kernel

Code

public function testMaintenanceModeCheck() {
  self::assertSame(NAGIOS_STATUS_OK, nagios_check_maintenance()['data']['status']);
  $form_object = SiteMaintenanceModeForm::create(\Drupal::getContainer());
  $form = [];
  $form_state = new FormState();
  $form_object
    ->submitForm($form, $form_state
    ->setValue('maintenance_mode', 1));
  self::assertSame(NAGIOS_STATUS_CRITICAL, nagios_check_maintenance()['data']['status']);
}