You are here

public function CronReportCase::testEnabledFail in Site Audit 8.2

Set cron frequency to 0 and don't run cron. Check should Fail.

File

tests/cronReportTest.php, line 66
Contains /site_audit/tests/CronReportCase.

Class

CronReportCase
Class CronReportCase.

Namespace

Unish

Code

public function testEnabledFail() {
  $eval1 = <<<EOT
\$config = \\Drupal::configFactory()->getEditable('system.cron');
\$config->set('threshold.autorun', 0);
\$config->save();
\\Drupal::state()->set('system.cron_last', NULL)
EOT;
  $this
    ->drush('php-eval', array(
    $eval1,
  ), $this->options);
  $this
    ->drush('audit-cron', array(), $this->options + array(
    'detail' => NULL,
    'json' => NULL,
  ));
  $output = json_decode($this
    ->getOutput());
  $this
    ->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL, $output->checks->SiteAuditCheckCronEnabled->score);
}