You are here

public function CheckTest::testDefaultResults in Security Review 8

Tests some check's results on a clean install of Drupal.

File

tests/src/Kernel/CheckTest.php, line 72

Class

CheckTest
Contains tests for Checks.

Namespace

Drupal\Tests\security_review\Kernel

Code

public function testDefaultResults() {
  $defaults = [
    'security_review-field' => CheckResult::SUCCESS,
  ];
  foreach ($this->checks as $check) {
    if (array_key_exists($check
      ->id(), $defaults)) {
      $result = $check
        ->run();
      $this
        ->assertEquals($defaults[$check
        ->id()], $result
        ->result(), $check
        ->getTitle() . ' produced the right result.');
    }
  }
}