/** * Tests whether checks returned by getEnabledChecks() are all enabled. */ public function testEnabledChecks() { foreach (Checklist::getEnabledChecks() as $check) { $this->assertFalse($check->isSkipped(), $check->getTitle() . ' is enabled.'); // Disable check. $check->skip(); } Checklist::clearCache(); $this->assertEqual(count(Checklist::getEnabledChecks()), 0, 'Disabled all checks.'); }
/** * Sets up the testing environment. */ protected function setUp() { parent::setUp(); // Login. $this->user = $this->drupalCreateUser(array('run security checks', 'access security review list', 'access administration pages', 'administer site configuration')); $this->drupalLogin($this->user); // Populate $checks. $this->checks = security_review_security_review_checks(); // Clear cache. Checklist::clearCache(); }