/** * Whether roles are found. * * @param T_Auth $auth * @return bool */ function isSatisfiedBy($auth) { $role = $auth->getRole(); foreach ($this->roles as $name) { if (!$role->is($name)) { return false; } } return true; }
function testRoleCanBeChanged() { $role1 = new T_Role_Collection(array()); $role2 = new T_Role_Collection(array()); $auth = new T_Auth(T_Auth::TOKEN, null, $role1); $auth->setRole($role2); $this->assertSame($role2, $auth->getRole()); }