You are here

public function WatchdogReportCase::test404Warn in Site Audit 8.2

Block the user with uid 1. Check should Fail.

File

tests/watchdogReportTest.php, line 28
Contains /site_audit/tests/WatchdogReportCase.

Class

WatchdogReportCase
Class WatchdogReportCase.

Namespace

Unish

Code

public function test404Warn() {
  $this
    ->drush('en', array(
    'dblog',
  ), $this->options);
  $eval1 = "\\Drupal::logger('page not found')->warning('drush tests');";
  for ($i = 0; $i < 100; $i++) {
    $this
      ->drush('php-eval', array(
      $eval1,
    ), $this->options);
  }
  $this
    ->drush('audit-watchdog', array(), $this->options + array(
    'detail' => NULL,
    'json' => NULL,
  ));
  $output = $this
    ->getOutput();
  $output = json_decode($output);
  $this
    ->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_WARN, $output->checks->SiteAuditCheckWatchdog404->score);
}