/** * Tests the 'untrusted_roles' setting. */ public function testConfigUntrustedRoles() { $this->assertEqual(SecurityReview::getUntrustedRoles(), array(), 'untrusted_roles empty by default.'); $roles = array(0, 1, 2, 3, 4); SecurityReview::setUntrustedRoles($roles); $this->assertEqual($roles, SecurityReview::getUntrustedRoles(), 'untrusted_roles set to test array.'); }
/** * Returns the IDs of untrusted roles. * * If the module hasn't been configured yet, it returns the default untrusted * roles. * * @return array * Untrusted roles' IDs. */ public static function untrustedRoles() { // If the module hasn't been manually configured yet, return the untrusted // roles depending on Drupal's actual configuration. if (!SecurityReview::isConfigured()) { return static::defaultUntrustedRoles(); } // Else return the stored untrusted roles. return SecurityReview::getUntrustedRoles(); }