/** * Is the given role status value is valid according to the configured RoleStatus values. * @see \RoleStatus * @param string $roleStatus role status * @return boolean */ public function isValidRoleStatus($roleStatus) { $roleStatuses = \RoleStatus::getAsArray(); foreach ($roleStatuses as $statusValue) { if ($statusValue == $roleStatus) { return TRUE; } } return FALSE; }
public function testRoleConstants() { print __METHOD__ . "\n"; $roleNames = RoleTypeName::getAsArray(); $this->assertEquals(RoleTypeName::SITE_ADMIN, $roleNames['SITE_ADMIN']); $this->assertEquals(RoleTypeName::COD_ADMIN, $roleNames['COD_ADMIN']); $roleStatusVals = RoleStatus::getAsArray(); $this->assertEquals(RoleStatus::GRANTED, $roleStatusVals['GRANTED']); $this->assertEquals(RoleStatus::PENDING, $roleStatusVals['PENDING']); }