You are here

public function CronReportCase::testEnabledWarn in Site Audit 8.2

Run the cron and set cron frequency to > 24 hours. Check should Warn.

File

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

Class

CronReportCase
Class CronReportCase.

Namespace

Unish

Code

public function testEnabledWarn() {
  $eval1 = <<<EOT
\$config = \\Drupal::configFactory()->getEditable('system.cron');
\$config->set('threshold.autorun', 25*60*60);
\$config->save();
EOT;
  $this
    ->drush('php-eval', array(
    $eval1,
  ), $this->options);
  $this
    ->drush('cron', array(), $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_WARN, $output->checks->SiteAuditCheckCronEnabled->score);
}