You are here

public function BestPracticesReportCase::testFast404Two in Site Audit 8.2

Fast_404 enabled and fast_404 paths not empty in fast_404, check passes.

File

tests/bestPracticesReportTest.php, line 46
Contains /site_audit/tests/BestPracticesReportCase.

Class

BestPracticesReportCase
Class BestPracticesReportCase.

Namespace

Unish

Code

public function testFast404Two() {
  $eval1 = <<<EOT
\$config = \\Drupal::configFactory()->getEditable('system.performance');
\$config->set('fast_404.enabled', TRUE);
\$config->set('fast_404.paths', '/\\.(?:txt|png)\$/i');
\$config->save();;
EOT;
  $this
    ->drush('php-eval', array(
    $eval1,
  ), $this->options);
  $this
    ->drush('audit-best-practices', array(), $this->options + array(
    'detail' => NULL,
    'json' => NULL,
  ));
  $output = json_decode($this
    ->getOutput());
  $this
    ->assertEquals(\SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS, $output->checks->SiteAuditCheckBestPracticesFast404->score);
}