user = $this->drupalCreateUser( [ 'run security checks', 'access security review list', 'access administration pages', 'administer site configuration', ] ); $this->drupalLogin($this->user); // Get checks. $this->checks = security_review_security_review_checks(); } /** * Tests Check::skip(). * * Checks whether skip() marks the check as skipped, and checks the * skippedBy() value. */ 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()); } } }