You are here

public function ChecklistWebTest::testRun in Security Review 8

Tests a full checklist run.

Tests whether the checks hasn't been run yet, then runs them and checks that their lastRun value is not 0.

File

tests/src/Functional/ChecklistWebTest.php, line 78

Class

ChecklistWebTest
Contains tests related to the SecurityReview class.

Namespace

Drupal\Tests\security_review\Functional

Code

public function testRun() {
  foreach ($this->checks as $check) {
    $this
      ->assertEqual(0, $check
      ->lastRun(), $check
      ->getTitle() . ' has not been run yet.');
  }
  $this->checklist
    ->runChecklist();
  foreach ($this->checks as $check) {
    $this
      ->assertNotEqual(0, $check
      ->lastRun(), $check
      ->getTitle() . ' has been run.');
  }
}