# Copyright (c) 2007 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: RealmAdmin.bunit,v 1.5 2010/12/09 16:17:05 nagler Exp $ ShellUtil(); my($uid); [ [qw(-realm general users)] => qr{^multi_role_user.*\nroot\b}s, [qw(-realm general users administrator)] => qr{^root\b}s, [qw(to_id demo)] => unauth_model(RealmOwner => {name => 'demo'})->get('realm_id'), [to_id => 'Demo User'] => unauth_model(RealmOwner => {name => 'demo'})->get('realm_id'), [qw(-realm site-reports -user crm_tech1 leave_user)] => not_die(), [qw(-realm site-reports users)] => sub { my(undef, $actual) = @_; assert_not_equals(qr{crm_tech1}, $actual->[0]); return 1; }, [qw(-realm site-reports -user crm_tech1 join_user member)] => not_die(), [qw(-realm site-reports users)] => qr{crm_tech1}, [qw(-realm site-reports -user crm_tech1 join_user member)] => not_die(), [qw(-realm site-reports -user crm_tech1 leave_user)] => not_die(), [qw(-realm site-reports users)] => sub { my(undef, $actual) = @_; assert_not_equals(qr{crm_tech1}, $actual->[0]); return 1; }, inline_case(sub { $uid = ShellUtil_TestUser()->create(random_realm_name()); my($uid2) = ShellUtil_TestUser()->create(random_realm_name()); class()->main(-realm => $uid, -user => $uid2, qw(join_user GUEST)); return; }), sub {[-realm => $uid, 'delete_auth_realm_and_users']} => not_die(), ];