You are here

public function ChecklistTest::testEnabledChecks in Security Review 8

Tests whether checks returned by getEnabledChecks() are all enabled.

File

tests/src/Kernel/ChecklistTest.php, line 92

Class

ChecklistTest
Contains test for Checklist.

Namespace

Drupal\Tests\security_review\Kernel

Code

public function testEnabledChecks() {
  foreach ($this->checklist
    ->getEnabledChecks() as $check) {
    $this
      ->assertFalse($check
      ->isSkipped(), $check
      ->getTitle() . ' is enabled.');

    // Disable check.
    $check
      ->skip();
  }
  Checklist::clearCache();
  $this
    ->assertEquals(0, count($this->checklist
    ->getEnabledChecks()), 'Disabled all checks.');
}