You are here

public function WatchdogReportCase::testPhpWarn in Site Audit 8.2

Create more than 10% php errors. Should Warn.

File

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

Class

WatchdogReportCase
Class WatchdogReportCase.

Namespace

Unish

Code

public function testPhpWarn() {
  $this
    ->drush('en', array(
    'dblog',
  ), $this->options);
  $eval1 = "\\Drupal::logger('php')->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->SiteAuditCheckWatchdogPhp->score);
}