CheckWebTest.php in Security Review 8
File
tests/src/Functional/CheckWebTest.php
View source
<?php
namespace Drupal\Tests\security_review\Functional;
use Drupal\Tests\BrowserTestBase;
class CheckWebTest extends BrowserTestBase {
public static $modules = [
'security_review',
];
protected $user;
protected $checks;
protected function setUp() {
parent::setUp();
$this->user = $this
->drupalCreateUser([
'run security checks',
'access security review list',
'access administration pages',
'administer site configuration',
]);
$this
->drupalLogin($this->user);
$this->checks = security_review_security_review_checks();
}
public function testSkipCheck() {
foreach ($this->checks as $check) {
$check
->skip();
$is_skipped = $check
->isSkipped();
$skipped_by = $check
->skippedBy();
$this
->assertTrue($is_skipped, $check
->getTitle() . ' skipped.');
$this
->assertEqual($this->user
->id(), $skipped_by
->id(), 'Skipped by ' . $skipped_by
->label());
}
}
}
Classes
Name |
Description |
CheckWebTest |
Contains tests for Check that don't suffice with KernelTestBase. |