5 * Contains \Drupal\security_review\Tests\CheckWebTest.
8 namespace Drupal\security_review\Tests;
10 use Drupal\simpletest\WebTestBase;
13 * Contains tests for Check that don't suffice with KernelTestBase.
15 * @group security_review
17 class CheckWebTest extends WebTestBase {
24 public static $modules = ['security_review'];
27 * The security checks defined by Security Review.
29 * @var \Drupal\security_review\Check[]
36 * @var \Drupal\user\Entity\User
41 * Sets up the testing environment, logs the user in, populates $check.
43 protected function setUp() {
47 $this->user = $this->drupalCreateUser(
49 'run security checks',
50 'access security review list',
51 'access administration pages',
52 'administer site configuration',
55 $this->drupalLogin($this->user);
58 $this->checks = security_review_security_review_checks();
62 * Tests Check::skip().
64 * Checks whether skip() marks the check as skipped, and checks the
67 public function testSkipCheck() {
68 foreach ($this->checks as $check) {
71 $is_skipped = $check->isSkipped();
72 $skipped_by = $check->skippedBy();
74 $this->assertTrue($is_skipped, $check->getTitle() . ' skipped.');
75 $this->assertEqual($this->user->id(), $skipped_by->id(), 'Skipped by ' . $skipped_by->label());