[Rt-commit] r7158 - in rt/branches/3.7-EXPERIMENTAL-TUNIS/lib: . RT RT/Condition RT/Interface RT/Search RT/URI

ruz at bestpractical.com ruz at bestpractical.com
Mon Mar 5 14:10:49 EST 2007


Author: ruz
Date: Mon Mar  5 14:10:46 2007
New Revision: 7158

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACE_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACL_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/CreateTickets.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/Generic.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/SendEmail.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachment_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachments_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attribute_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CachedGroupMembers_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/Generic.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/OwnerChange.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CurrentUser.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomField_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomFields_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Date.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/EmailParser.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMember_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMembers_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Group_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Groups_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Handle.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/I18N.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/CLI.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Link_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Links_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Principals_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queue_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queues_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearch.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearches.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripAction_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripActions_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripCondition_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripConditions_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrip_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrips_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/ActiveTicketsInQueue.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/FromSQL.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Generic.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Googleish.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SearchBuilder.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/System.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Template_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Templates_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay_SQL.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transaction_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transactions_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/fsck_com_rt.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/t.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/User_Overlay.pm
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Users_Overlay.pm

Log:
* drop inline tests

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT.pm.in	Mon Mar  5 14:10:46 2007
@@ -391,14 +391,6 @@
 L<RT::StyleGuide>
 L<DBIx::SearchBuilder>
 
-=begin testing
-
-ok ($RT::Nobody->Name() eq 'Nobody', "Nobody is nobody");
-ok ($RT::Nobody->Name() ne 'root', "Nobody isn't named root");
-ok ($RT::SystemUser->Name() eq 'RT_System', "The system user is RT_System");
-ok ($RT::SystemUser->Name() ne 'noname', "The system user isn't noname");
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACE_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACE_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACE_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -56,11 +56,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok(require RT::ACE);
-
-=end testing
 
 =cut
 
@@ -88,15 +83,6 @@
 # to real people or groups
 
 
-=begin testing
-
-my $Queue = RT::Queue->new($RT::SystemUser);
-
-is ($Queue->AvailableRights->{'DeleteTicket'} , 'Delete tickets', "Found the delete ticket right");
-is ($RT::System->AvailableRights->{'SuperUser'},  'Do anything and everything', "Found the superuser right");
-
-
-=end testing
 
 =cut
 
@@ -346,216 +332,6 @@
 
 Always returns a tuple of (ReturnValue, Message)
 
-=begin testing
-
-use_ok(RT::User);
-my $user_a = RT::User->new($RT::SystemUser);
-$user_a->Create( Name => 'DelegationA', Privileged => 1);
-ok ($user_a->Id, "Created delegation user a");
-
-my $user_b = RT::User->new($RT::SystemUser);
-$user_b->Create( Name => 'DelegationB', Privileged => 1);
-ok ($user_b->Id, "Created delegation user b");
-
-
-use_ok(RT::Queue);
-my $q = RT::Queue->new($RT::SystemUser);
-$q->Create(Name =>'DelegationTest');
-ok ($q->Id, "Created a delegation test queue");
-
-
-#------ First, we test whether a user can delegate a right that's been granted to him personally 
-my ($val, $msg) = $user_a->PrincipalObj->GrantRight(Object => $RT::System, Right => 'AdminOwnPersonalGroups');
-ok($val, $msg);
-
-($val, $msg) = $user_a->PrincipalObj->GrantRight(Object =>$q, Right => 'OwnTicket');
-ok($val, $msg);
-
-ok($user_a->HasRight( Object => $RT::System, Right => 'AdminOwnPersonalGroups')    ,"user a has the right 'AdminOwnPersonalGroups' directly");
-
-my $a_delegates = RT::Group->new($user_a);
-$a_delegates->CreatePersonalGroup(Name => 'Delegates');
-ok( $a_delegates->Id   ,"user a creates a personal group 'Delegates'");
-ok( $a_delegates->AddMember($user_b->PrincipalId)   ,"user a adds user b to personal group 'delegates'");
-
-ok( !$user_b->HasRight(Right => 'OwnTicket', Object => $q)    ,"user b does not have the right to OwnTicket' in queue 'DelegationTest'");
-ok(  $user_a->HasRight(Right => 'OwnTicket', Object => $q)  ,"user a has the right to 'OwnTicket' in queue 'DelegationTest'");
-ok(!$user_a->HasRight( Object => $RT::System, Right => 'DelegateRights')    ,"user a does not have the right 'delegate rights'");
-
-
-my $own_ticket_ace = RT::ACE->new($user_a);
-my $user_a_equiv_group = RT::Group->new($user_a);
-$user_a_equiv_group->LoadACLEquivalenceGroup($user_a->PrincipalObj);
-ok ($user_a_equiv_group->Id, "Loaded the user A acl equivalence group");
-my $user_b_equiv_group = RT::Group->new($user_b);
-$user_b_equiv_group->LoadACLEquivalenceGroup($user_b->PrincipalObj);
-ok ($user_b_equiv_group->Id, "Loaded the user B acl equivalence group");
-$own_ticket_ace->LoadByValues( PrincipalType => 'Group', PrincipalId => $user_a_equiv_group->PrincipalId, Object=>$q, RightName => 'OwnTicket');
-
-ok ($own_ticket_ace->Id, "Found the ACE we want to test with for now");
-
-
-($val, $msg) = $own_ticket_ace->Delegate(PrincipalId => $a_delegates->PrincipalId)  ;
-ok( !$val ,"user a tries and fails to delegate the right 'ownticket' in queue 'DelegationTest' to personal group 'delegates' - $msg");
-
-
-($val, $msg) = $user_a->PrincipalObj->GrantRight( Right => 'DelegateRights');
-ok($val, "user a is granted the right to 'delegate rights' - $msg");
-
-ok($user_a->HasRight( Object => $RT::System, Right => 'DelegateRights')    ,"user a has the right 'AdminOwnPersonalGroups' directly");
-
-($val, $msg) = $own_ticket_ace->Delegate(PrincipalId => $a_delegates->PrincipalId) ;
-
-ok( $val    ,"user a tries and succeeds to delegate the right 'ownticket' in queue 'DelegationTest' to personal group 'delegates' - $msg");
-ok(  $user_b->HasRight(Right => 'OwnTicket', Object => $q)  ,"user b has the right to own tickets in queue 'DelegationTest'");
-my $delegated_ace = RT::ACE->new($user_a);
-$delegated_ace->LoadByValues ( Object => $q, RightName => 'OwnTicket', PrincipalType => 'Group',
-PrincipalId => $a_delegates->PrincipalId, DelegatedBy => $user_a->PrincipalId, DelegatedFrom => $own_ticket_ace->Id);
-ok ($delegated_ace->Id, "Found the delegated ACE");
-
-ok(    $a_delegates->DeleteMember($user_b->PrincipalId)  ,"user a removes b from pg 'delegates'");
-ok(  !$user_b->HasRight(Right => 'OwnTicket', Object => $q)  ,"user b does not have the right to own tickets in queue 'DelegationTest'");
-ok(  $a_delegates->AddMember($user_b->PrincipalId)    ,"user a adds user b to personal group 'delegates'");
-ok(   $user_b->HasRight(Right => 'OwnTicket', Object=> $q) ,"user b has the right to own tickets in queue 'DelegationTest'");
-ok(   $delegated_ace->Delete ,"user a revokes pg 'delegates' right to 'OwnTickets' in queue 'DelegationTest'");
-ok( ! $user_b->HasRight(Right => 'OwnTicket', Object => $q)   ,"user b does not have the right to own tickets in queue 'DelegationTest'");
-
-($val, $msg) = $own_ticket_ace->Delegate(PrincipalId => $a_delegates->PrincipalId)  ;
-ok(  $val  ,"user a delegates pg 'delegates' right to 'OwnTickets' in queue 'DelegationTest' - $msg");
-
-ok( $user_a->HasRight(Right => 'OwnTicket', Object => $q)    ,"user a does not have the right to own tickets in queue 'DelegationTest'");
-
-($val, $msg) = $user_a->PrincipalObj->RevokeRight(Object=>$q, Right => 'OwnTicket');
-ok($val, "Revoked user a's right to own tickets in queue 'DelegationTest". $msg);
-
-ok( !$user_a->HasRight(Right => 'OwnTicket', Object => $q)    ,"user a does not have the right to own tickets in queue 'DelegationTest'");
-
- ok( !$user_b->HasRight(Right => 'OwnTicket', Object => $q)   ,"user b does not have the right to own tickets in queue 'DelegationTest'");
-
-($val, $msg) = $user_a->PrincipalObj->GrantRight(Object=>$q, Right => 'OwnTicket');
-ok($val, $msg);
-
- ok( $user_a->HasRight(Right => 'OwnTicket', Object => $q)   ,"user a has the right to own tickets in queue 'DelegationTest'");
-
- ok(  !$user_b->HasRight(Right => 'OwnTicket', Object => $q)  ,"user b does not have the right to own tickets in queue 'DelegationTest'");
-
-# {{{ get back to a known clean state 
-($val, $msg) = $user_a->PrincipalObj->RevokeRight( Object => $q, Right => 'OwnTicket');
-ok($val, "Revoked user a's right to own tickets in queue 'DelegationTest -". $msg);
-ok( !$user_a->HasRight(Right => 'OwnTicket', Object => $q)    ,"make sure that user a can't own tickets in queue 'DelegationTest'");
-# }}}
-
-
-# {{{ Set up some groups and membership
-my $del1 = RT::Group->new($RT::SystemUser);
-($val, $msg) = $del1->CreateUserDefinedGroup(Name => 'Del1');
-ok( $val   ,"create a group del1 - $msg");
-
-my $del2 = RT::Group->new($RT::SystemUser);
-($val, $msg) = $del2->CreateUserDefinedGroup(Name => 'Del2');
-ok( $val   ,"create a group del2 - $msg");
-($val, $msg) = $del1->AddMember($del2->PrincipalId);
-ok( $val,"make del2 a member of del1 - $msg");
-
-my $del2a = RT::Group->new($RT::SystemUser);
-($val, $msg) = $del2a->CreateUserDefinedGroup(Name => 'Del2a');
-ok( $val   ,"create a group del2a - $msg");
-($val, $msg) = $del2->AddMember($del2a->PrincipalId);  
-ok($val    ,"make del2a a member of del2 - $msg");
-
-my $del2b = RT::Group->new($RT::SystemUser);
-($val, $msg) = $del2b->CreateUserDefinedGroup(Name => 'Del2b');
-ok( $val   ,"create a group del2b - $msg");
-($val, $msg) = $del2->AddMember($del2b->PrincipalId);  
-ok($val    ,"make del2b a member of del2 - $msg");
-
-($val, $msg) = $del2->AddMember($user_a->PrincipalId) ;
-ok($val,"make 'user a' a member of del2 - $msg");
-
-($val, $msg) = $del2b->AddMember($user_a->PrincipalId) ;
-ok($val,"make 'user a' a member of del2b - $msg");
-
-# }}}
-
-# {{{ Grant a right to a group and make sure that a submember can delegate the right and that it does not get yanked
-# when a user is removed as a submember, when they're a sumember through another path 
-($val, $msg) = $del1->PrincipalObj->GrantRight( Object=> $q, Right => 'OwnTicket');
-ok( $val   ,"grant del1  the right to 'OwnTicket' in queue 'DelegationTest' - $msg");
-
-ok(  $user_a->HasRight(Right => 'OwnTicket', Object => $q)  ,"make sure that user a can own tickets in queue 'DelegationTest'");
-
-my $group_ace= RT::ACE->new($user_a);
-$group_ace->LoadByValues( PrincipalType => 'Group', PrincipalId => $del1->PrincipalId, Object => $q, RightName => 'OwnTicket');
-
-ok ($group_ace->Id, "Found the ACE we want to test with for now");
-
-($val, $msg) = $group_ace->Delegate(PrincipalId => $a_delegates->PrincipalId);
-
-ok( $val   ,"user a tries and succeeds to delegate the right 'ownticket' in queue 'DelegationTest' to personal group 'delegates' - $msg");
-ok(  $user_b->HasRight(Right => 'OwnTicket', Object => $q)  ,"user b has the right to own tickets in queue 'DelegationTest'");
-
-
-($val, $msg) = $del2b->DeleteMember($user_a->PrincipalId);
-ok( $val   ,"remove user a from group del2b - $msg");
-ok(  $user_a->HasRight(Right => 'OwnTicket', Object => $q)  ,"user a has the right to own tickets in queue 'DelegationTest'");
-ok( $user_b->HasRight(Right => 'OwnTicket', Object => $q)    ,"user b has the right to own tickets in queue 'DelegationTest'");
-
-# }}}
-
-# {{{ When a  user is removed froom a group by the only path they're in there by, make sure the delegations go away
-($val, $msg) = $del2->DeleteMember($user_a->PrincipalId);
-ok( $val   ,"remove user a from group del2 - $msg");
-ok(  !$user_a->HasRight(Right => 'OwnTicket', Object => $q)  ,"user a does not have the right to own tickets in queue 'DelegationTest' ");
-ok(  !$user_b->HasRight(Right => 'OwnTicket', Object => $q)  ,"user b does not have the right to own tickets in queue 'DelegationTest' ");
-# }}}
-
-($val, $msg) = $del2->AddMember($user_a->PrincipalId);
-ok( $val   ,"make user a a member of group del2 - $msg");
-
-($val, $msg) = $del2->PrincipalObj->GrantRight(Object=>$q, Right => 'OwnTicket');
-ok($val, "grant the right 'own tickets' in queue 'DelegationTest' to group del2 - $msg");
-
-my $del2_right = RT::ACE->new($user_a);
-$del2_right->LoadByValues( PrincipalId => $del2->PrincipalId, PrincipalType => 'Group', Object => $q, RightName => 'OwnTicket');
-ok ($del2_right->Id, "Found the right");
-
-($val, $msg) = $del2_right->Delegate(PrincipalId => $a_delegates->PrincipalId);
-ok( $val   ,"user a tries and succeeds to delegate the right 'ownticket' in queue 'DelegationTest' gotten via del2 to personal group 'delegates' - $msg");
-
-# They have it via del1 and del2
-ok( $user_a->HasRight(Right => 'OwnTicket', Object => $q)   ,"user b has the right to own tickets in queue 'DelegationTest'");
-
-
-($val, $msg) = $del2->PrincipalObj->RevokeRight(Object=>$q, Right => 'OwnTicket');
-ok($val, "revoke the right 'own tickets' in queue 'DelegationTest' to group del2 - $msg");
-ok(  $user_a->HasRight(Right => 'OwnTicket', Object => $q)  ,"user a does has the right to own tickets in queue 'DelegationTest' via del1");
-ok(  !$user_b->HasRight(Right => 'OwnTicket', Object => $q)   ,"user b does not have the right to own tickets in queue 'DelegationTest'");
-
-($val, $msg) = $del2->PrincipalObj->GrantRight(Object=>$q, Right => 'OwnTicket');
-ok($val, "grant the right 'own tickets' in queue 'DelegationTest' to group del2 - $msg");
-
-
-$group_ace= RT::ACE->new($user_a);
-$group_ace->LoadByValues( PrincipalType => 'Group', PrincipalId => $del1->PrincipalId, Object=>$q, RightName => 'OwnTicket');
-
-ok ($group_ace->Id, "Found the ACE we want to test with for now");
-
-($val, $msg) = $group_ace->Delegate(PrincipalId => $a_delegates->PrincipalId);
-
-ok( $val   ,"user a tries and succeeds to delegate the right 'ownticket' in queue 'DelegationTest' to personal group 'delegates' - $msg");
-
-ok( $user_b->HasRight(Right => 'OwnTicket', Object => $q)    ,"user b has the right to own tickets in queue 'DelegationTest'");
-
-($val, $msg) = $del2->DeleteMember($user_a->PrincipalId);
-ok( $val   ,"remove user a from group del2 - $msg");
-
-ok(  !$user_a->HasRight(Right => 'OwnTicket', Object => $q)  ,"user a does not have the right to own tickets in queue 'DelegationTest'");
-
-ok(  !$user_b->HasRight(Right => 'OwnTicket', Object => $q)   ,"user b does not have the right to own tickets in queue 'DelegationTest'");
-
-
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACL_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACL_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ACL_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok(require RT::ACL);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/CreateTickets.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/CreateTickets.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/CreateTickets.pm	Mon Mar  5 14:10:46 2007
@@ -234,236 +234,6 @@
 be treated as the same thing.
 
 
-=begin testing
-
-ok (require RT::Action::CreateTickets);
-use_ok(RT::Scrip);
-use_ok(RT::Template);
-use_ok(RT::ScripAction);
-use_ok(RT::ScripCondition);
-use_ok(RT::Ticket);
-
-my $approvalsq = RT::Queue->new($RT::SystemUser);
-$approvalsq->Create(Name => 'Approvals');
-ok ($approvalsq->Id, "Created Approvals test queue");
-
-
-my $approvals = 
-'===Create-Ticket: approval
-Queue: ___Approvals
-Type: approval
-AdminCc: {join ("\nAdminCc: ", at admins) }
-Depended-On-By: {$Tickets{"TOP"}->Id}
-Refers-To: TOP 
-Subject: Approval for ticket: {$Tickets{"TOP"}->Id} - {$Tickets{"TOP"}->Subject}
-Due: {time + 86400}
-Content-Type: text/plain
-Content: Your approval is requested for the ticket {$Tickets{"TOP"}->Id}: {$Tickets{"TOP"}->Subject}
-Blah
-Blah
-ENDOFCONTENT
-===Create-Ticket: two
-Subject: Manager approval.
-Depended-On-By: approval
-Queue: ___Approvals
-Content-Type: text/plain
-Content: 
-Your minion approved ticket {$Tickets{"TOP"}->Id}. you ok with that?
-ENDOFCONTENT
-';
-
-ok ($approvals =~ /Content/, "Read in the approvals template");
-
-my $apptemp = RT::Template->new($RT::SystemUser);
-$apptemp->Create( Content => $approvals, Name => "Approvals", Queue => "0");
-
-ok ($apptemp->Id);
-
-my $q = RT::Queue->new($RT::SystemUser);
-$q->Create(Name => 'WorkflowTest');
-ok ($q->Id, "Created workflow test queue");
-
-my $scrip = RT::Scrip->new($RT::SystemUser);
-my ($sval, $smsg) =$scrip->Create( ScripCondition => 'On Transaction',
-                ScripAction => 'Create Tickets',
-                Template => 'Approvals',
-                Queue => $q->Id);
-ok ($sval, $smsg);
-ok ($scrip->Id, "Created the scrip");
-ok ($scrip->TemplateObj->Id, "Created the scrip template");
-ok ($scrip->ConditionObj->Id, "Created the scrip condition");
-ok ($scrip->ActionObj->Id, "Created the scrip action");
-
-my $t = RT::Ticket->new($RT::SystemUser);
-my($tid, $ttrans, $tmsg) = $t->Create(Subject => "Sample workflow test",
-           Owner => "root",
-           Queue => $q->Id);
-
-ok ($tid,$tmsg);
-
-my $deps = $t->DependsOn;
-is ($deps->Count, 1, "The ticket we created depends on one other ticket");
-my $dependson= $deps->First->TargetObj;
-ok ($dependson->Id, "It depends on a real ticket");
-unlike ($dependson->Subject, qr/{/, "The subject doesn't have braces in it. that means we're interpreting expressions");
-is ($t->ReferredToBy->Count,1, "It's only referred to by one other ticket");
-is ($t->ReferredToBy->First->BaseObj->Id,$t->DependsOn->First->TargetObj->Id, "The same ticket that depends on it refers to it.");
-use RT::Action::CreateTickets;
-my $action =  RT::Action::CreateTickets->new( CurrentUser => $RT::SystemUser);;
-
-# comma-delimited templates
-my $commas = <<"EOF";
-id,Queue,Subject,Owner,Content
-ticket1,General,"foo, bar",root,blah
-ticket2,General,foo bar,root,blah
-ticket3,General,foo' bar,root,blah'boo
-ticket4,General,foo' bar,,blah'boo
-EOF
-
-
-# Comma delimited templates with missing data
-my $sparse_commas = <<"EOF";
-id,Queue,Subject,Owner,Requestor
-ticket14,General,,,bobby
-ticket15,General,,,tommy
-ticket16,General,,suzie,tommy
-ticket17,General,Foo "bar" baz,suzie,tommy
-ticket18,General,'Foo "bar" baz',suzie,tommy
-ticket19,General,'Foo bar' baz,suzie,tommy
-EOF
-
-
-# tab-delimited templates
-my $tabs = <<"EOF";
-id\tQueue\tSubject\tOwner\tContent
-ticket10\tGeneral\t"foo' bar"\troot\tblah'
-ticket11\tGeneral\tfoo, bar\troot\tblah
-ticket12\tGeneral\tfoo' bar\troot\tblah'boo
-ticket13\tGeneral\tfoo' bar\t\tblah'boo
-EOF
-
-my %expected;
-
-$expected{ticket1} = <<EOF;
-Queue: General
-Subject: foo, bar
-Owner: root
-Content: blah
-ENDOFCONTENT
-EOF
-
-$expected{ticket2} = <<EOF;
-Queue: General
-Subject: foo bar
-Owner: root
-Content: blah
-ENDOFCONTENT
-EOF
-
-$expected{ticket3} = <<EOF;
-Queue: General
-Subject: foo' bar
-Owner: root
-Content: blah'boo
-ENDOFCONTENT
-EOF
-
-$expected{ticket4} = <<EOF;
-Queue: General
-Subject: foo' bar
-Owner: 
-Content: blah'boo
-ENDOFCONTENT
-EOF
-
-$expected{ticket10} = <<EOF;
-Queue: General
-Subject: foo' bar
-Owner: root
-Content: blah'
-ENDOFCONTENT
-EOF
-
-$expected{ticket11} = <<EOF;
-Queue: General
-Subject: foo, bar
-Owner: root
-Content: blah
-ENDOFCONTENT
-EOF
-
-$expected{ticket12} = <<EOF;
-Queue: General
-Subject: foo' bar
-Owner: root
-Content: blah'boo
-ENDOFCONTENT
-EOF
-
-$expected{ticket13} = <<EOF;
-Queue: General
-Subject: foo' bar
-Owner: 
-Content: blah'boo
-ENDOFCONTENT
-EOF
-
-
-$expected{'ticket14'} = <<EOF;
-Queue: General
-Subject: 
-Owner: 
-Requestor: bobby
-EOF
-$expected{'ticket15'} = <<EOF;
-Queue: General
-Subject: 
-Owner: 
-Requestor: tommy
-EOF
-$expected{'ticket16'} = <<EOF;
-Queue: General
-Subject: 
-Owner: suzie
-Requestor: tommy
-EOF
-$expected{'ticket17'} = <<EOF;
-Queue: General
-Subject: Foo "bar" baz
-Owner: suzie
-Requestor: tommy
-EOF
-$expected{'ticket18'} = <<EOF;
-Queue: General
-Subject: Foo "bar" baz
-Owner: suzie
-Requestor: tommy
-EOF
-$expected{'ticket19'} = <<EOF;
-Queue: General
-Subject: 'Foo bar' baz
-Owner: suzie
-Requestor: tommy
-EOF
-
-
-
-
-$action->Parse(Content =>$commas);
-$action->Parse(Content =>$sparse_commas);
-$action->Parse(Content => $tabs);
-
-my %got;
-foreach (@{ $action->{'create_tickets'} }) {
-  $got{$_} = $action->{'templates'}->{$_};
-}
-
-foreach my $id ( sort keys %expected ) {
-    ok(exists($got{"create-$id"}), "template exists for $id");
-    is($got{"create-$id"}, $expected{$id}, "template is correct for $id");
-}
-
-=end testing
 
 
 =head1 AUTHOR

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/Generic.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/Generic.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/Generic.pm	Mon Mar  5 14:10:46 2007
@@ -56,11 +56,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok (require RT::Action::Generic);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/SendEmail.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/SendEmail.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Action/SendEmail.pm	Mon Mar  5 14:10:46 2007
@@ -75,11 +75,6 @@
 Basically, you create another module RT::Action::YourAction which ISA
 RT::Action::SendEmail.
 
-=begin testing
-
-ok (require RT::Action::SendEmail);
-
-=end testing
 
 
 =head1 AUTHOR

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachment_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -59,11 +59,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Attachment);
-
-=end testing
 
 =cut
 
@@ -553,34 +548,6 @@
 Returns an array of this attachment object's headers, with one header 
 per array entry. multiple lines are folded.
 
-=begin testing
-
-my $test1 = "From: jesse";
-my @headers = RT::Attachment->_SplitHeaders($test1);
-is ($#headers, 0, $test1 );
-
-my $test2 = qq{From: jesse
-To: bobby
-Subject: foo
-};
-
- at headers = RT::Attachment->_SplitHeaders($test2);
-is ($#headers, 2, "testing a bunch of singline multiple headers" );
-
-
-my $test3 = qq{From: jesse
-To: bobby,
- Suzie,
-    Sally,
-    Joey: bizzy,
-Subject: foo
-};
-
- at headers = RT::Attachment->_SplitHeaders($test3);
-is ($#headers, 2, "testing a bunch of singline multiple headers" );
-
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachments_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachments_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attachments_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -61,11 +61,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Attachments);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attribute_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attribute_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Attribute_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -286,38 +286,6 @@
 
 Returns the subvalue for $key.
 
-=begin testing
-
-my $user = $RT::SystemUser;
-my ($id, $msg) =  $user->AddAttribute(Name => 'SavedSearch', Content => { Query => 'Foo'} );
-ok ($id, $msg);
-my $attr = RT::Attribute->new($RT::SystemUser);
-$attr->Load($id);
-ok($attr->Name eq 'SavedSearch');
-$attr->SetSubValues( Format => 'baz');
-
-my $format = $attr->SubValue('Format');
-is ($format , 'baz');
-
-$attr->SetSubValues( Format => 'bar');
-$format = $attr->SubValue('Format');
-is ($format , 'bar');
-
-$attr->DeleteAllSubValues();
-$format = $attr->SubValue('Format');
-is ($format, undef);
-
-$attr->SetSubValues(Format => 'This is a format');
-
-my $attr2 = RT::Attribute->new($RT::SystemUser);
-$attr2->Load($id);
-is ($attr2->SubValue('Format'), 'This is a format');
-$attr2->Delete;
-my $attr3 = RT::Attribute->new($RT::SystemUser);
-my ($id) = $attr3->Load($id);
-is ($id, 0);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CachedGroupMembers_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CachedGroupMembers_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CachedGroupMembers_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::CachedGroupMembers);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/Generic.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/Generic.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/Generic.pm	Mon Mar  5 14:10:46 2007
@@ -69,11 +69,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Condition::Generic);
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/OwnerChange.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/OwnerChange.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Condition/OwnerChange.pm	Mon Mar  5 14:10:46 2007
@@ -58,47 +58,6 @@
 
 If we're changing the owner return true, otherwise return false
 
-=begin testing
-
-my $q = RT::Queue->new($RT::SystemUser);
-$q->Create(Name =>'ownerChangeTest');
-
-ok($q->Id, "Created a scriptest queue");
-
-my $s1 = RT::Scrip->new($RT::SystemUser);
-my ($val, $msg) =$s1->Create( Queue => $q->Id,
-             ScripAction => 'User Defined',
-             ScripCondition => 'On Owner Change',
-             CustomIsApplicableCode => '',
-             CustomPrepareCode => 'return 1',
-             CustomCommitCode => '
-                    $self->TicketObj->SetPriority($self->TicketObj->Priority+1);
-                return(1);
-            ',
-             Template => 'Blank'
-    );
-ok($val,$msg);
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-my ($tv,$ttv,$tm) = $ticket->Create(Queue => $q->Id,
-                                    Subject => "hair on fire",
-                                    InitialPriority => '20'
-                                    );
-ok($tv, $tm);
-ok($ticket->SetOwner('root'));
-is ($ticket->Priority , '21', "Ticket priority is set right");
-ok($ticket->Steal);
-is ($ticket->Priority , '22', "Ticket priority is set right");
-ok($ticket->Untake);
-is ($ticket->Priority , '23', "Ticket priority is set right");
-ok($ticket->Take);
-is ($ticket->Priority , '24', "Ticket priority is set right");
-
-
-
-
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CurrentUser.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CurrentUser.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CurrentUser.pm	Mon Mar  5 14:10:46 2007
@@ -59,11 +59,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::CurrentUser);
-
-=end testing
 
 =cut
 
@@ -198,21 +193,6 @@
 Returns this current user's langauge handle. Should take a language
 specification. but currently doesn't
 
-=begin testing
-
-ok (my $cu = RT::CurrentUser->new('root'));
-ok (my $lh = $cu->LanguageHandle('en-us'));
-ok ($lh != undef);
-ok ($lh->isa('Locale::Maketext'));
-is ($cu->loc('TEST_STRING'), "Concrete Mixer", "Localized TEST_STRING into English");
-SKIP: {
-    skip "French localization is not enabled", 2
-        unless grep $_ && $_ =~ /^(\*|fr)$/, RT->Config->Get('LexiconLanguages');
-    ok ($lh = $cu->LanguageHandle('fr'));
-    is ($cu->loc('Before'), "Avant", "Localized TEST_STRING into French");
-}
-
-=end testing
 
 =cut 
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomField_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomField_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomField_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -304,37 +304,6 @@
 
 # {{{ Dealing with custom field values 
 
-=begin testing
-
-use_ok(RT::CustomField);
-ok(my $cf = RT::CustomField->new($RT::SystemUser));
-ok(my ($id, $msg)=  $cf->Create( Name => 'TestingCF',
-                                 Queue => '0',
-                                 SortOrder => '1',
-                                 Description => 'A Testing custom field',
-                                 Type=> 'SelectSingle'), 'Created a global CustomField');
-ok($id != 0, 'Global custom field correctly created');
-ok ($cf->SingleValue);
-is($cf->Type, 'Select');
-is($cf->MaxValues, 1);
-
-my ($val, $msg) = $cf->SetMaxValues('0');
-ok($val, $msg);
-is($cf->Type, 'Select');
-is($cf->MaxValues, 0);
-ok(!$cf->SingleValue );
-ok(my ($bogus_val, $bogus_msg) = $cf->SetType('BogusType') , "Trying to set a custom field's type to a bogus type");
-ok($bogus_val == 0, "Unable to set a custom field's type to a bogus type");
-
-ok(my $bad_cf = RT::CustomField->new($RT::SystemUser));
-ok(my ($bad_id, $bad_msg)=  $cf->Create( Name => 'TestingCF-bad',
-                                 Queue => '0',
-                                 SortOrder => '1',
-                                 Description => 'A Testing custom field with a bogus Type',
-                                 Type=> 'SelectSingleton'), 'Created a global CustomField with a bogus type');
-ok($bad_id == 0, 'Global custom field correctly decided to not create a cf with a bogus type ');
-
-=end testing
 
 =cut
 
@@ -369,17 +338,6 @@
 
 Create a new value for this CustomField.  Takes a paramhash containing the elements Name, Description and SortOrder
 
-=begin testing
-
-ok(my $cf = RT::CustomField->new($RT::SystemUser));
-$cf->Load(1);
-ok($cf->Id == 1);
-ok(my ($val,$msg)  = $cf->AddValue(Name => 'foo' , Description => 'TestCFValue', SortOrder => '6'));
-ok($val != 0);
-ok (my ($delval, $delmsg) = $cf->DeleteValue($val));
-ok ($delval,"Deleting a cf value: $delmsg");
-
-=end testing
 
 =cut
 
@@ -561,14 +519,6 @@
 Takes a single string. returns true if that string is a value
 type of custom field
 
-=begin testing
-
-ok(my $cf = RT::CustomField->new($RT::SystemUser));
-ok($cf->ValidateType('SelectSingle'));
-ok($cf->ValidateType('SelectMultiple'));
-ok(!$cf->ValidateType('SelectFooMultiple'));
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomFields_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomFields_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/CustomFields_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -57,11 +57,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::CustomFields);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Date.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Date.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Date.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 
 The fact that it assumes that a time of 0 means "never" is probably a bug.
 
-=begin testing
-
-ok (require RT::Date);
-
-=end testing
 
 =head1 METHODS
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/EmailParser.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/EmailParser.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/EmailParser.pm	Mon Mar  5 14:10:46 2007
@@ -68,11 +68,6 @@
 =head1 DESCRIPTION
 
 
-=begin testing
-
-ok(require RT::EmailParser);
-
-=end testing
 
 
 =head1 METHODS
@@ -407,12 +402,6 @@
 Returns true if that address matches the C<RTAddressRegexp> config option.
 Returns false, otherwise.
 
-=begin testing
-
-is(RT::EmailParser::IsRTAddress("","rt\@example.com"),1, "Regexp matched rt address" );
-is(RT::EmailParser::IsRTAddress("","frt\@example.com"),undef, "Regexp didn't match non-rt address" );
-
-=end testing
 
 =cut
 
@@ -439,13 +428,6 @@
 Takes a single argument, an array of email addresses.
 Returns the same array with any IsRTAddress()es weeded out.
 
-=begin testing
-
- at before = ("rt\@example.com", "frt\@example.com");
- at after = ("frt\@example.com");
-ok(eq_array(RT::EmailParser::CullRTAddresses("", at before), at after), "CullRTAddresses only culls RT addresses");
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMember_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMember_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMember_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -64,11 +64,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::GroupMember);
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMembers_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMembers_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/GroupMembers_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::GroupMembers);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Group_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Group_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Group_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -62,85 +62,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-# {{{ Tests
-ok (require RT::Group);
-
-ok (my $group = RT::Group->new($RT::SystemUser), "instantiated a group object");
-ok (my ($id, $msg) = $group->CreateUserDefinedGroup( Name => 'TestGroup', Description => 'A test group',
-                    ), 'Created a new group');
-ok ($id != 0, "Group id is $id");
-ok ($group->Name eq 'TestGroup', "The group's name is 'TestGroup'");
-my $ng = RT::Group->new($RT::SystemUser);
-
-ok($ng->LoadUserDefinedGroup('TestGroup'), "Loaded testgroup");
-ok(($ng->id == $group->id), "Loaded the right group");
-
-
-ok (($id,$msg) = $ng->AddMember('1'), "Added a member to the group");
-ok($id, $msg);
-ok (($id,$msg) = $ng->AddMember('2' ), "Added a member to the group");
-ok($id, $msg);
-ok (($id,$msg) = $ng->AddMember('3' ), "Added a member to the group");
-ok($id, $msg);
-
-# Group 1 now has members 1, 2 ,3
-
-my $group_2 = RT::Group->new($RT::SystemUser);
-ok (my ($id_2, $msg_2) = $group_2->CreateUserDefinedGroup( Name => 'TestGroup2', Description => 'A second test group'), , 'Created a new group');
-ok ($id_2 != 0, "Created group 2 ok- $msg_2 ");
-ok (($id,$msg) = $group_2->AddMember($ng->PrincipalId), "Made TestGroup a member of testgroup2");
-ok($id, $msg);
-ok (($id,$msg) = $group_2->AddMember('1' ), "Added  member RT_System to the group TestGroup2");
-ok($id, $msg);
-
-# Group 2 how has 1, g1->{1, 2,3}
-
-my $group_3 = RT::Group->new($RT::SystemUser);
-ok (($id_3, $msg) = $group_3->CreateUserDefinedGroup( Name => 'TestGroup3', Description => 'A second test group'), 'Created a new group');
-ok ($id_3 != 0, "Created group 3 ok - $msg");
-ok (($id,$msg) =$group_3->AddMember($group_2->PrincipalId), "Made TestGroup a member of testgroup2");
-ok($id, $msg);
-
-# g3 now has g2->{1, g1->{1,2,3}}
-
-my $principal_1 = RT::Principal->new($RT::SystemUser);
-$principal_1->Load('1');
-
-my $principal_2 = RT::Principal->new($RT::SystemUser);
-$principal_2->Load('2');
-
-ok (($id,$msg) = $group_3->AddMember('1' ), "Added  member RT_System to the group TestGroup2");
-ok($id, $msg);
-
-# g3 now has 1, g2->{1, g1->{1,2,3}}
-
-ok($group_3->HasMember($principal_2) == undef, "group 3 doesn't have member 2");
-ok($group_3->HasMemberRecursively($principal_2), "group 3 has member 2 recursively");
-ok($ng->HasMember($principal_2) , "group ".$ng->Id." has member 2");
-my ($delid , $delmsg) =$ng->DeleteMember($principal_2->Id);
-ok ($delid !=0, "Sucessfully deleted it-".$delid."-".$delmsg);
-
-#Gotta reload the group objects, since we've been messing with various internals.
-# we shouldn't need to do this.
-#$ng->LoadUserDefinedGroup('TestGroup');
-#$group_2->LoadUserDefinedGroup('TestGroup2');
-#$group_3->LoadUserDefinedGroup('TestGroup');
-
-# G1 now has 1, 3
-# Group 2 how has 1, g1->{1, 3}
-# g3 now has  1, g2->{1, g1->{1, 3}}
-
-ok(!$ng->HasMember($principal_2)  , "group ".$ng->Id." no longer has member 2");
-ok($group_3->HasMemberRecursively($principal_2) == undef, "group 3 doesn't have member 2");
-ok($group_2->HasMemberRecursively($principal_2) == undef, "group 2 doesn't have member 2");
-ok($ng->HasMember($principal_2) == undef, "group 1 doesn't have member 2");;
-ok($group_3->HasMemberRecursively($principal_2) == undef, "group 3 has member 2 recursively");
-
-# }}}
-
-=end testing
 
 
 
@@ -1359,14 +1280,6 @@
 if there's no principal object matching this user. 
 The response is cached. PrincipalObj should never ever change.
 
-=begin testing
-
-ok(my $u = RT::Group->new($RT::SystemUser));
-ok($u->Load(4), "Loaded the first user");
-ok($u->PrincipalObj->ObjectId == 4, "user 4 is the fourth principal");
-ok($u->PrincipalObj->PrincipalType eq 'Group' , "Principal 4 is a group");
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Groups_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Groups_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Groups_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -63,11 +63,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Groups);
-
-=end testing
 
 =cut
 
@@ -87,21 +82,6 @@
 
 # {{{ sub _Init
 
-=begin testing
-
-# next had bugs
-# Groups->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => xx );
-my $g = RT::Group->new($RT::SystemUser);
-my ($id, $msg) = $g->CreateUserDefinedGroup(Name => 'GroupsNotEqualTest');
-ok ($id, "created group #". $g->id) or diag("error: $msg");
-
-my $groups = RT::Groups->new($RT::SystemUser);
-$groups->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => $g->id );
-$groups->LimitToUserDefinedGroups();
-my $bug = grep $_->id == $g->id, @{$groups->ItemsArrayRef};
-ok (!$bug, "didn't find group");
-
-=end testing
 
 =cut
 
@@ -265,27 +245,6 @@
 Limits the set of groups returned to groups which have
 Principal PRINCIPAL_ID as a member
    
-=begin testing
-
-my $u = RT::User->new($RT::SystemUser);
-my ($id, $msg) = $u->Create( Name => 'Membertests'. $$ );
-ok ($id, 'created user') or diag "error: $msg";
-
-my $g = RT::Group->new($RT::SystemUser);
-($id, $msg) = $g->CreateUserDefinedGroup(Name => 'Membertests');
-ok ($id, $msg);
-
-my ($aid, $amsg) =$g->AddMember($u->id);
-ok ($aid, $amsg);
-ok($g->HasMember($u->PrincipalObj),"G has member u");
-
-my $groups = RT::Groups->new($RT::SystemUser);
-$groups->LimitToUserDefinedGroups();
-$groups->WithMember(PrincipalId => $u->id);
-ok ($groups->Count == 1,"found the 1 group - " . $groups->Count);
-ok ($groups->First->Id == $g->Id, "it's the right one");
-
-=end testing
 
 
 =cut
@@ -314,87 +273,6 @@
 
 Find all groups which have RIGHTNAME for RT::Record. Optionally include global rights and superusers. By default, include the global rights, but not the superusers.
 
-=begin testing
-
-my $q = RT::Queue->new($RT::SystemUser);
-my ($id, $msg) =$q->Create( Name => 'GlobalACLTest');
-ok ($id, $msg);
-
-my $testuser = RT::User->new($RT::SystemUser);
-($id,$msg) = $testuser->Create(Name => 'JustAnAdminCc');
-ok ($id,$msg);
-
-my $global_admin_cc = RT::Group->new($RT::SystemUser);
-$global_admin_cc->LoadSystemRoleGroup('AdminCc');
-ok($global_admin_cc->id, "Found the global admincc group");
-my $groups = RT::Groups->new($RT::SystemUser);
-$groups->WithRight(Right => 'OwnTicket', Object => $q);
-is($groups->Count, 1);
-($id, $msg) = $global_admin_cc->PrincipalObj->GrantRight(Right =>'OwnTicket', Object=> $RT::System);
-ok ($id,$msg);
-ok (!$testuser->HasRight(Object => $q, Right => 'OwnTicket') , "The test user does not have the right to own tickets in the test queue");
-($id, $msg) = $q->AddWatcher(Type => 'AdminCc', PrincipalId => $testuser->id);
-ok($id,$msg);
-ok ($testuser->HasRight(Object => $q, Right => 'OwnTicket') , "The test user does have the right to own tickets now. thank god.");
-
-$groups = RT::Groups->new($RT::SystemUser);
-$groups->WithRight(Right => 'OwnTicket', Object => $q);
-ok ($id,$msg);
-is($groups->Count, 3);
-
-my $RTxGroup = RT::Group->new($RT::SystemUser);
-($id, $msg) = $RTxGroup->CreateUserDefinedGroup( Name => 'RTxGroup', Description => "RTx extension group");
-ok ($id,$msg);
-is ($RTxGroup->id, $id, "group loaded");
-
-my $RTxSysObj = {};
-bless $RTxSysObj, 'RTx::System';
-*RTx::System::Id = sub { 1; };
-*RTx::System::id = *RTx::System::Id;
-my $ace = RT::Record->new($RT::SystemUser);
-$ace->Table('ACL');
-$ace->_BuildTableAttributes unless ($_TABLE_ATTR->{ref($self)});
-($id, $msg) = $ace->Create( PrincipalId => $RTxGroup->id, PrincipalType => 'Group', RightName => 'RTxGroupRight', ObjectType => 'RTx::System', ObjectId  => 1);
-ok ($id, "ACL for RTxSysObj created");
-
-my $RTxObj = {};
-bless $RTxObj, 'RTx::System::Record';
-*RTx::System::Record::Id = sub { 4; };
-*RTx::System::Record::id = *RTx::System::Record::Id;
-
-$groups = RT::Groups->new($RT::SystemUser);
-$groups->WithRight(Right => 'RTxGroupRight', Object => $RTxSysObj);
-is($groups->Count, 1, "RTxGroupRight found for RTxSysObj");
-
-$groups = RT::Groups->new($RT::SystemUser);
-$groups->WithRight(Right => 'RTxGroupRight', Object => $RTxObj);
-is($groups->Count, 0, "RTxGroupRight not found for RTxObj");
-
-$groups = RT::Groups->new($RT::SystemUser);
-$groups->WithRight(Right => 'RTxGroupRight', Object => $RTxObj, EquivObjects => [ $RTxSysObj ]);
-is($groups->Count, 1, "RTxGroupRight found for RTxObj using EquivObjects");
-
-$ace = RT::Record->new($RT::SystemUser);
-$ace->Table('ACL');
-$ace->_BuildTableAttributes unless ($_TABLE_ATTR->{ref($self)});
-($id, $msg) = $ace->Create( PrincipalId => $RTxGroup->id, PrincipalType => 'Group', RightName => 'RTxGroupRight', ObjectType => 'RTx::System::Record', ObjectId  => 5 );
-ok ($id, "ACL for RTxObj created");
-
-my $RTxObj2 = {};
-bless $RTxObj2, 'RTx::System::Record';
-*RTx::System::Record::Id = sub { 5; };
-
-$groups = RT::Groups->new($RT::SystemUser);
-$groups->WithRight(Right => 'RTxGroupRight', Object => $RTxObj2);
-is($groups->Count, 1, "RTxGroupRight found for RTxObj2");
-
-$groups = RT::Groups->new($RT::SystemUser);
-$groups->WithRight(Right => 'RTxGroupRight', Object => $RTxObj2, EquivObjects => [ $RTxSysObj ]);
-is($groups->Count, 1, "RTxGroupRight found for RTxObj2");
-
-
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Handle.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Handle.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Handle.pm	Mon Mar  5 14:10:46 2007
@@ -54,11 +54,6 @@
 
 =head1 DESCRIPTION
 
-=begin testing
-
-ok(require RT::Handle);
-
-=end testing
 
 =head1 METHODS
 
@@ -400,7 +395,7 @@
     my $datafile = shift;
 
     #Connect to the database and get RT::SystemUser and RT::Nobody loaded
-    RT::Init;
+    RT::Init();
 
     my $CurrentUser = RT::CurrentUser->new();
     $CurrentUser->LoadByName('RT_System');

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/I18N.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/I18N.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/I18N.pm	Mon Mar  5 14:10:46 2007
@@ -85,12 +85,6 @@
 
 Initializes the lexicons used for localization.
 
-=begin testing
-
-use_ok (RT::I18N);
-ok(RT::I18N->Init);
-
-=end testing
 
 =cut
 
@@ -136,18 +130,6 @@
 Returns the encoding of the current lexicon, as yanked out of __ContentType's "charset" field.
 If it can't find anything, it returns 'ISO-8859-1'
 
-=begin testing
-
-ok(my $chinese = RT::I18N->get_handle('zh_tw'));
-ok(UNIVERSAL::can($chinese, 'maketext'));
-ok($chinese->maketext('__Content-Type') =~ /utf-8/i, "Found the utf-8 charset for traditional chinese in the string ".$chinese->maketext('__Content-Type'));
-ok($chinese->encoding eq 'utf-8', "The encoding is 'utf-8' -".$chinese->encoding);
-
-ok(my $en = RT::I18N->get_handle('en'));
-ok(UNIVERSAL::can($en, 'maketext'));
-ok($en->encoding eq 'utf-8', "The encoding ".$en->encoding." is 'utf-8'");
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/CLI.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/CLI.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/CLI.pm	Mon Mar  5 14:10:46 2007
@@ -98,11 +98,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok(require RT::Interface::CLI);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email.pm	Mon Mar  5 14:10:46 2007
@@ -93,11 +93,6 @@
 =head1 DESCRIPTION
 
 
-=begin testing
-
-ok(require RT::Interface::Email);
-
-=end testing
 
 
 =head1 METHODS

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Web.pm	Mon Mar  5 14:10:46 2007
@@ -53,11 +53,6 @@
 
 RT::Interface::Web
 
-=begin testing
-
-use_ok(RT::Interface::Web);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Link_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Link_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Link_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -60,20 +60,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-
-use RT::Link;
-my $link = RT::Link->new($RT::SystemUser);
-
-
-ok (ref $link);
-ok (UNIVERSAL::isa($link, 'RT::Link'));
-ok (UNIVERSAL::isa($link, 'RT::Base'));
-ok (UNIVERSAL::isa($link, 'RT::Record'));
-ok (UNIVERSAL::isa($link, 'DBIx::SearchBuilder::Record'));
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Links_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Links_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Links_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -59,11 +59,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Links);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Principals_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Principals_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Principals_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Principals);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queue_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queue_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queue_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -61,7 +61,6 @@
 
 use RT::Queue;
 
-=end testing
 
 =cut
 
@@ -234,13 +233,6 @@
 
 Returns true if VALUE is a valid status.  Otherwise, returns 0.
 
-=begin testing
-
-my $q = RT::Queue->new($RT::SystemUser);
-ok($q->IsValidStatus('new')== 1, 'New is a valid status');
-ok($q->IsValidStatus('f00')== 0, 'f00 is not a valid status');
-
-=end testing
 
 =cut
 
@@ -261,14 +253,6 @@
 
 Returns true if VALUE is a Active status.  Otherwise, returns 0
 
-=begin testing
-
-my $q = RT::Queue->new($RT::SystemUser);
-ok($q->IsActiveStatus('new')== 1, 'New is a Active status');
-ok($q->IsActiveStatus('rejected')== 0, 'Rejected is an inactive status');
-ok($q->IsActiveStatus('f00')== 0, 'f00 is not a Active status');
-
-=end testing
 
 =cut
 
@@ -289,14 +273,6 @@
 
 Returns true if VALUE is a Inactive status.  Otherwise, returns 0
 
-=begin testing
-
-my $q = RT::Queue->new($RT::SystemUser);
-ok($q->IsInactiveStatus('new')== 0, 'New is a Active status');
-ok($q->IsInactiveStatus('rejected')== 1, 'rejeected is an Inactive status');
-ok($q->IsInactiveStatus('f00')== 0, 'f00 is not a Active status');
-
-=end testing
 
 =cut
 
@@ -331,16 +307,6 @@
  
 If you pass the ACL check, it creates the queue and returns its queue id.
 
-=begin testing
-
-my $queue = RT::Queue->new($RT::SystemUser);
-my ($id, $val) = $queue->Create( Name => 'Test1');
-ok($id, $val);
-
-($id, $val) = $queue->Create( Name => '66');
-ok(!$id, $val);
-
-=end testing
 
 =cut
 
@@ -639,34 +605,6 @@
 
 It will return true on success and undef on failure.
 
-=begin testing
-
-my $Queue = RT::Queue->new($RT::SystemUser); my ($id, $msg) = $Queue->Create(Name => "Foo",
-                );
-ok ($id, "Foo $id was created");
-ok(my $group = RT::Group->new($RT::SystemUser));
-ok($group->LoadQueueRoleGroup(Queue => $id, Type=> 'Cc'));
-ok ($group->Id, "Found the requestors object for this Queue");
-
-
-ok ((my $add_id, $add_msg) = $Queue->AddWatcher(Type => 'Cc', Email => 'bob at fsck.com'), "Added bob at fsck.com as a requestor");
-ok ($add_id, "Add succeeded: ($add_msg)");
-ok(my $bob = RT::User->new($RT::SystemUser), "Creating a bob rt::user");
-$bob->LoadByEmail('bob at fsck.com');
-ok($bob->Id,  "Found the bob rt user");
-ok ($Queue->IsWatcher(Type => 'Cc', PrincipalId => $bob->PrincipalId), "The Queue actually has bob at fsck.com as a requestor");;
-ok ((my $add_id, $add_msg) = $Queue->DeleteWatcher(Type =>'Cc', Email => 'bob at fsck.com'), "Added bob at fsck.com as a requestor");
-ok (!$Queue->IsWatcher(Type => 'Cc', Principal => $bob->PrincipalId), "The Queue no longer has bob at fsck.com as a requestor");;
-
-
-$group = RT::Group->new($RT::SystemUser);
-ok($group->LoadQueueRoleGroup(Queue => $id, Type=> 'Cc'));
-ok ($group->Id, "Found the cc object for this Queue");
-$group = RT::Group->new($RT::SystemUser);
-ok($group->LoadQueueRoleGroup(Queue => $id, Type=> 'AdminCc'));
-ok ($group->Id, "Found the AdminCc object for this Queue");
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queues_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queues_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Queues_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Queues);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Record.pm	Mon Mar  5 14:10:46 2007
@@ -54,11 +54,6 @@
 =head1 DESCRIPTION
 
 
-=begin testing
-
-ok (require RT::Record);
-
-=end testing
 
 =head1 METHODS
 
@@ -129,14 +124,6 @@
 Returns a string which is this object's type.  The type is the class,
 without the "RT::" prefix.
 
-=begin testing
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-my $group = RT::Group->new($RT::SystemUser);
-is($ticket->ObjectTypeStr, 'Ticket', "Ticket returns correct typestring");
-is($group->ObjectTypeStr, 'Group', "Group returns correct typestring");
-
-=end testing
 
 =cut
 
@@ -1025,49 +1012,6 @@
 of that type.  Returns false otherwise
 
 
-=begin testing
-
-my $t1 = RT::Ticket->new($RT::SystemUser);
-my ($id, $trans, $msg) = $t1->Create(Subject => 'DepTest1', Queue => 'general');
-ok($id, "Created dep test 1 - $msg");
-
-my $t2 = RT::Ticket->new($RT::SystemUser);
-my ($id2, $trans, $msg2) = $t2->Create(Subject => 'DepTest2', Queue => 'general');
-ok($id2, "Created dep test 2 - $msg2");
-my $t3 = RT::Ticket->new($RT::SystemUser);
-my ($id3, $trans, $msg3) = $t3->Create(Subject => 'DepTest3', Queue => 'general', Type => 'approval');
-ok($id3, "Created dep test 3 - $msg3");
-my ($addid, $addmsg);
-ok (($addid, $addmsg) =$t1->AddLink( Type => 'DependsOn', Target => $t2->id));
-ok ($addid, $addmsg);
-ok (($addid, $addmsg) =$t1->AddLink( Type => 'DependsOn', Target => $t3->id));
-
-ok ($addid, $addmsg);
-my $link = RT::Link->new($RT::SystemUser);
-my ($rv, $msg) = $link->Load($addid);
-ok ($rv, $msg);
-ok ($link->LocalTarget == $t3->id, "Link LocalTarget is correct");
-ok ($link->LocalBase   == $t1->id, "Link LocalBase   is correct");
-
-ok ($t1->HasUnresolvedDependencies, "Ticket ".$t1->Id." has unresolved deps");
-ok (!$t1->HasUnresolvedDependencies( Type => 'blah' ), "Ticket ".$t1->Id." has no unresolved blahs");
-ok ($t1->HasUnresolvedDependencies( Type => 'approval' ), "Ticket ".$t1->Id." has unresolved approvals");
-ok (!$t2->HasUnresolvedDependencies, "Ticket ".$t2->Id." has no unresolved deps");
-;
-
-my ($rid, $rmsg)= $t1->Resolve();
-ok(!$rid, $rmsg);
-my ($rid2, $rmsg2) = $t2->Resolve();
-ok ($rid2, $rmsg2);
-($rid, $rmsg)= $t1->Resolve();
-ok(!$rid, $rmsg);
-my ($rid3,$rmsg3) = $t3->Resolve;
-ok ($rid3,$rmsg3);
-($rid, $rmsg)= $t1->Resolve();
-ok($rid, $rmsg);
-
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearch.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearch.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearch.pm	Mon Mar  5 14:10:46 2007
@@ -60,13 +60,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-use_ok(RT::SavedSearch);
-
-# Real tests are in lib/t/20savedsearch.t
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearches.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearches.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SavedSearches.pm	Mon Mar  5 14:10:46 2007
@@ -60,13 +60,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-use_ok(RT::SavedSearches);
-
-# The real tests are in lib/t/20savedsearch.t
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripAction_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripAction_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripAction_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -59,11 +59,6 @@
 should only be accessed through exported APIs in other modules.
 
 
-=begin testing
-
-ok (require RT::ScripAction);
-
-=end testing
 
 =head1 METHODS
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripActions_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripActions_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripActions_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -56,11 +56,6 @@
 =head1 DESCRIPTION
 
 
-=begin testing
-
-ok (require RT::ScripActions);
-
-=end testing
 
 =head1 METHODS
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripCondition_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripCondition_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripCondition_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -59,11 +59,6 @@
 should only be accessed through exported APIs in other modules.
 
 
-=begin testing
-
-ok (require RT::ScripCondition);
-
-=end testing
 
 =head1 METHODS
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripConditions_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripConditions_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/ScripConditions_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -57,11 +57,6 @@
 
 
 
-=begin testing
-
-ok (require RT::ScripConditions);
-
-=end testing
 
 =head1 METHODS
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrip_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrip_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrip_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -57,45 +57,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok (require RT::Scrip);
-
-
-my $q = RT::Queue->new($RT::SystemUser);
-$q->Create(Name => 'ScripTest');
-ok($q->Id, "Created a scriptest queue");
-
-my $s1 = RT::Scrip->new($RT::SystemUser);
-my ($val, $msg) =$s1->Create( Queue => $q->Id,
-             ScripAction => 'User Defined',
-             ScripCondition => 'User Defined',
-             CustomIsApplicableCode => 'if ($self->TicketObj->Subject =~ /fire/) { return (1);} else { return(0)}',
-             CustomPrepareCode => 'return 1',
-             CustomCommitCode => '$self->TicketObj->SetPriority("87");',
-             Template => 'Blank'
-    );
-ok($val,$msg);
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-my ($tv,$ttv,$tm) = $ticket->Create(Queue => $q->Id,
-                                    Subject => "hair on fire",
-                                    );
-ok($tv, $tm);
-
-ok ($ticket->Priority == '87', "Ticket priority is set right");
-
-
-my $ticket2 = RT::Ticket->new($RT::SystemUser);
-my ($t2v,$t2tv,$t2m) = $ticket2->Create(Queue => $q->Id,
-                                    Subject => "hair in water",
-                                    );
-ok($t2v, $t2m);
-
-ok ($ticket2->Priority != '87', "Ticket priority is set right");
-
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrips_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrips_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Scrips_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Scrips);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/ActiveTicketsInQueue.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/ActiveTicketsInQueue.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/ActiveTicketsInQueue.pm	Mon Mar  5 14:10:46 2007
@@ -57,11 +57,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Search::Generic);
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/FromSQL.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/FromSQL.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/FromSQL.pm	Mon Mar  5 14:10:46 2007
@@ -57,11 +57,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Search::Generic);
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Generic.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Generic.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Generic.pm	Mon Mar  5 14:10:46 2007
@@ -66,11 +66,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Search::Generic);
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Googleish.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Search/Googleish.pm	Mon Mar  5 14:10:46 2007
@@ -57,11 +57,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::Search::Generic);
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SearchBuilder.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SearchBuilder.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/SearchBuilder.pm	Mon Mar  5 14:10:46 2007
@@ -56,11 +56,6 @@
 =head1 METHODS
 
 
-=begin testing
-
-ok (require RT::SearchBuilder);
-
-=end testing
 
 
 =cut
@@ -343,29 +338,6 @@
 Return this object's ItemsArray, in the order that ItemsOrderBy sorts
 it.
 
-=begin testing
-
-use_ok(RT::Queues);
-ok(my $queues = RT::Queues->new($RT::SystemUser), 'Created a queues object');
-ok( $queues->UnLimit(),'Unlimited the result set of the queues object');
-my $items = $queues->ItemsArrayRef();
-my @items = @{$items};
-
-ok($queues->NewItem->_Accessible('Name','read'));
-my @sorted = sort {lc($a->Name) cmp lc($b->Name)} @items;
-ok (@sorted, "We have an array of queues, sorted". join(',',map {$_->Name} @sorted));
-
-ok (@items, "We have an array of queues, raw". join(',',map {$_->Name} @items));
-my @sorted_ids = map {$_->id } @sorted;
-my @items_ids = map {$_->id } @items;
-
-is ($#sorted, $#items);
-is ($sorted[0]->Name, $items[0]->Name);
-is ($sorted[-1]->Name, $items[-1]->Name);
-is_deeply(\@items_ids, \@sorted_ids, "ItemsArrayRef sorts alphabetically by name");;
-
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/System.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/System.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/System.pm	Mon Mar  5 14:10:46 2007
@@ -100,19 +100,6 @@
 
 Returns a hash of available rights for this object. The keys are the right names and the values are a description of what the rights do
 
-=begin testing
-
-my $s = RT::System->new($RT::SystemUser);
-my $rights = $s->AvailableRights;
-ok ($rights, "Rights defined");
-ok ($rights->{'AdminUsers'},"AdminUsers right found");
-ok ($rights->{'CreateTicket'},"CreateTicket right found");
-ok ($rights->{'AdminGroupMembership'},"ModifyGroupMembers right found");
-ok (!$rights->{'CasdasdsreateTicket'},"bogus right not found");
-
-
-
-=end testing
 
 
 =cut
@@ -143,14 +130,6 @@
 Returns RT::System's id. It's 1. 
 
 
-=begin testing
-
-use RT::System;
-my $sys = RT::System->new();
-is( $sys->Id, 1);
-is ($sys->id, 1);
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Template_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Template_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Template_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok(require RT::Template);
-
-=end testing
 
 =cut
 
@@ -120,15 +115,6 @@
 Returns its value as a string, if the user passes an ACL check
 
 
-=begin testing
-
-my $t = RT::Template->new($RT::SystemUser);
-$t->Create(Name => "Foo", Queue => 1);
-my $t2 = RT::Template->new($RT::Nobody);
-$t2->Load($t->Id);
-ok($t2->QueueObj->id, "Got the template's queue objet");
-
-=end testing
 
 
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Templates_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Templates_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Templates_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -57,11 +57,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok (require RT::Templates);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Ticket_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,82 +58,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-use_ok ( RT::Queue);
-ok(my $testqueue = RT::Queue->new($RT::SystemUser));
-ok($testqueue->Create( Name => 'ticket tests'));
-ok($testqueue->Id != 0);
-use_ok(RT::CustomField);
-ok(my $testcf = RT::CustomField->new($RT::SystemUser));
-my ($ret, $cmsg) = $testcf->Create( Name => 'selectmulti',
-                    Queue => $testqueue->id,
-                               Type => 'SelectMultiple');
-ok($ret,"Created the custom field - ".$cmsg);
-($ret,$cmsg) = $testcf->AddValue ( Name => 'Value1',
-                        SortOrder => '1',
-                        Description => 'A testing value');
-
-ok($ret, "Added a value - ".$cmsg);
-
-ok($testcf->AddValue ( Name => 'Value2',
-                        SortOrder => '2',
-                        Description => 'Another testing value'));
-ok($testcf->AddValue ( Name => 'Value3',
-                        SortOrder => '3',
-                        Description => 'Yet Another testing value'));
-                       
-ok($testcf->Values->Count == 3);
-
-use_ok(RT::Ticket);
-
-my $u = RT::User->new($RT::SystemUser);
-$u->Load("root");
-ok ($u->Id, "Found the root user");
-ok(my $t = RT::Ticket->new($RT::SystemUser));
-ok(my ($id, $msg) = $t->Create( Queue => $testqueue->Id,
-               Subject => 'Testing',
-               Owner => $u->Id
-              ));
-ok($id != 0);
-ok ($t->OwnerObj->Id == $u->Id, "Root is the ticket owner");
-ok(my ($cfv, $cfm) =$t->AddCustomFieldValue(Field => $testcf->Id,
-                           Value => 'Value1'));
-ok($cfv != 0, "Custom field creation didn't return an error: $cfm");
-ok($t->CustomFieldValues($testcf->Id)->Count == 1);
-ok($t->CustomFieldValues($testcf->Id)->First &&
-    $t->CustomFieldValues($testcf->Id)->First->Content eq 'Value1');;
-
-ok(my ($cfdv, $cfdm) = $t->DeleteCustomFieldValue(Field => $testcf->Id,
-                        Value => 'Value1'));
-ok ($cfdv != 0, "Deleted a custom field value: $cfdm");
-ok($t->CustomFieldValues($testcf->Id)->Count == 0);
-
-ok(my $t2 = RT::Ticket->new($RT::SystemUser));
-ok($t2->Load($id));
-is($t2->Subject, 'Testing');
-is($t2->QueueObj->Id, $testqueue->id);
-ok($t2->OwnerObj->Id == $u->Id);
-
-my $t3 = RT::Ticket->new($RT::SystemUser);
-my ($id3, $msg3) = $t3->Create( Queue => $testqueue->Id,
-                                Subject => 'Testing',
-                                Owner => $u->Id);
-my ($cfv1, $cfm1) = $t->AddCustomFieldValue(Field => $testcf->Id,
- Value => 'Value1');
-ok($cfv1 != 0, "Adding a custom field to ticket 1 is successful: $cfm");
-my ($cfv2, $cfm2) = $t3->AddCustomFieldValue(Field => $testcf->Id,
- Value => 'Value2');
-ok($cfv2 != 0, "Adding a custom field to ticket 2 is successful: $cfm");
-my ($cfv3, $cfm3) = $t->AddCustomFieldValue(Field => $testcf->Id,
- Value => 'Value3');
-ok($cfv3 != 0, "Adding a custom field to ticket 1 is successful: $cfm");
-ok($t->CustomFieldValues($testcf->Id)->Count == 2,
-   "This ticket has 2 custom field values");
-ok($t3->CustomFieldValues($testcf->Id)->Count == 1,
-   "This ticket has 1 custom field value");
-
-=end testing
 
 =cut
 
@@ -156,16 +80,6 @@
 use RT::URI;
 use MIME::Entity;
 
-=begin testing
-
-
-ok(require RT::Ticket, "Loading the RT::Ticket library");
-
-=end testing
-
-=cut
-
-# }}}
 
 # {{{ LINKTYPEMAP
 # A helper table for links mapping to make it easier
@@ -331,18 +245,6 @@
 Returns: TICKETID, Transaction Object, Error Message
 
 
-=begin testing
-
-my $t = RT::Ticket->new($RT::SystemUser);
-
-ok( $t->Create(Queue => 'General', Due => '2002-05-21 00:00:00', ReferredToBy => 'http://www.cpan.org', RefersTo => 'http://fsck.com', Subject => 'This is a subject'), "Ticket Created");
-
-ok ( my $id = $t->Id, "Got ticket id");
-ok ($t->RefersTo->First->Target =~ /fsck.com/, "Got refers to");
-ok ($t->ReferredToBy->First->Base =~ /cpan.org/, "Got referredtoby");
-is ($t->ResolvedObj->Unix, 0, "It hasn't been resolved - ". $t->ResolvedObj->Unix);
-
-=end testing
 
 =cut
 
@@ -780,24 +682,6 @@
 Returns an um. ask me again when the code exists
 
 
-=begin testing
-
-my $simple_update = <<EOF;
-Subject: target
-AddRequestor: jesse\@example.com
-EOF
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-my ($id,$msg) =$ticket->Create(Subject => 'first', Queue => 'general');
-ok($ticket->Id, "Created the test ticket - ".$id ." - ".$msg);
-$ticket->UpdateFrom822($simple_update);
-is($ticket->Subject, 'target', "changed the subject");
-my $jesse = RT::User->new($RT::SystemUser);
-$jesse->LoadByEmail('jesse at example.com');
-ok ($jesse->Id, "There's a user for jesse");
-ok($ticket->Requestors->HasMember( $jesse->PrincipalObj), "It has the jesse principal object as a requestor ");
-
-=end testing
 
 
 =cut
@@ -1216,48 +1100,6 @@
 
 It will return true on success and undef on failure.
 
-=begin testing
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-my ($id, $msg) = $ticket->Create(Subject => "Foo",
-                Owner => $RT::SystemUser->Id,
-                Status => 'open',
-                Requestor => ['jesse at example.com'],
-                Queue => '1'
-                );
-ok ($id, "Ticket $id was created");
-ok(my $group = RT::Group->new($RT::SystemUser));
-ok($group->LoadTicketRoleGroup(Ticket => $id, Type=> 'Requestor'));
-ok ($group->Id, "Found the requestors object for this ticket");
-
-ok(my $jesse = RT::User->new($RT::SystemUser), "Creating a jesse rt::user");
-$jesse->LoadByEmail('jesse at example.com');
-ok($jesse->Id,  "Found the jesse rt user");
-
-
-ok ($ticket->IsWatcher(Type => 'Requestor', PrincipalId => $jesse->PrincipalId), "The ticket actually has jesse at fsck.com as a requestor");
-ok ((my $add_id, $add_msg) = $ticket->AddWatcher(Type => 'Requestor', Email => 'bob at fsck.com'), "Added bob at fsck.com as a requestor");
-ok ($add_id, "Add succeeded: ($add_msg)");
-ok(my $bob = RT::User->new($RT::SystemUser), "Creating a bob rt::user");
-$bob->LoadByEmail('bob at fsck.com');
-ok($bob->Id,  "Found the bob rt user");
-ok ($ticket->IsWatcher(Type => 'Requestor', PrincipalId => $bob->PrincipalId), "The ticket actually has bob at fsck.com as a requestor");;
-ok ((my $add_id, $add_msg) = $ticket->DeleteWatcher(Type =>'Requestor', Email => 'bob at fsck.com'), "Added bob at fsck.com as a requestor");
-ok (!$ticket->IsWatcher(Type => 'Requestor', Principal => $bob->PrincipalId), "The ticket no longer has bob at fsck.com as a requestor");;
-
-
-$group = RT::Group->new($RT::SystemUser);
-ok($group->LoadTicketRoleGroup(Ticket => $id, Type=> 'Cc'));
-ok ($group->Id, "Found the cc object for this ticket");
-$group = RT::Group->new($RT::SystemUser);
-ok($group->LoadTicketRoleGroup(Ticket => $id, Type=> 'AdminCc'));
-ok ($group->Id, "Found the AdminCc object for this ticket");
-$group = RT::Group->new($RT::SystemUser);
-ok($group->LoadTicketRoleGroup(Ticket => $id, Type=> 'Owner'));
-ok ($group->Id, "Found the Owner object for this ticket");
-ok($group->HasMember($RT::SystemUser->UserObj->PrincipalObj), "the owner group has the member 'RT_System'");
-
-=end testing
 
 =cut
 
@@ -1574,35 +1416,6 @@
 
 Returns an array of the RT::Attribute objects for this ticket's 'SquelchMailTo' attributes.
 
-=begin testing
-
-my $t = RT::Ticket->new($RT::SystemUser);
-ok($t->Create(Queue => 'general', Subject => 'SquelchTest'));
-
-is($#{$t->SquelchMailTo}, -1, "The ticket has no squelched recipients");
-
-my @returned = $t->SquelchMailTo('nobody at example.com');
-
-is($#returned, 0, "The ticket has one squelched recipients");
-
-my @names = $t->Attributes->Names;
-is(shift @names, 'SquelchMailTo', "The attribute we have is SquelchMailTo");
- at returned = $t->SquelchMailTo('nobody at example.com');
-
-
-is($#returned, 0, "The ticket has one squelched recipients");
-
- at names = $t->Attributes->Names;
-is(shift @names, 'SquelchMailTo', "The attribute we have is SquelchMailTo");
-
-
-my ($ret, $msg) = $t->UnsquelchMailTo('nobody at example.com');
-ok($ret, "Removed nobody as a squelched recipient - ".$msg);
- at returned = $t->SquelchMailTo();
-is($#returned, -1, "The ticket has no squelched recipients". join(',', at returned));
-
-
-=end testing
 
 =cut
 
@@ -2712,26 +2525,6 @@
 MergeInto take the id of the ticket to merge this ticket into.
 
 
-=begin testing
-
-my $t1 = RT::Ticket->new($RT::SystemUser);
-$t1->Create ( Subject => 'Merge test 1', Queue => 'general', Requestor => 'merge1 at example.com');
-my $t1id = $t1->id;
-my $t2 = RT::Ticket->new($RT::SystemUser);
-$t2->Create ( Subject => 'Merge test 2', Queue => 'general', Requestor => 'merge2 at example.com');
-my $t2id = $t2->id;
-my ($msg, $val) = $t1->MergeInto($t2->id);
-ok ($msg,$val);
-$t1 = RT::Ticket->new($RT::SystemUser);
-is ($t1->id, undef, "ok. we've got a blank ticket1");
-$t1->Load($t1id);
-
-is ($t1->id, $t2->id);
-
-is ($t1->Requestors->MembersObj->Count, 2);
-
-
-=end testing
 
 =cut
 
@@ -2944,28 +2737,6 @@
 and  (optionally) the type of the SetOwner Transaction. It defaults
 to 'Give'.  'Steal' is also a valid option.
 
-=begin testing
-
-my $root = RT::User->new($RT::SystemUser);
-$root->Load('root');
-ok ($root->Id, "Loaded the root user");
-my $t = RT::Ticket->new($RT::SystemUser);
-$t->Load(1);
-$t->SetOwner('root');
-is ($t->OwnerObj->Name, 'root' , "Root owns the ticket");
-$t->Steal();
-is ($t->OwnerObj->id, $RT::SystemUser->id , "SystemUser owns the ticket");
-my $txns = RT::Transactions->new($RT::SystemUser);
-$txns->OrderBy(FIELD => 'id', ORDER => 'DESC');
-$txns->Limit(FIELD => 'ObjectId', VALUE => '1');
-$txns->Limit(FIELD => 'ObjectType', VALUE => 'RT::Ticket');
-$txns->Limit(FIELD => 'Type', OPERATOR => '!=',  VALUE => 'EmailRecord');
-
-my $steal  = $txns->First;
-ok($steal->OldValue == $root->Id , "Stolen from root");
-ok($steal->NewValue == $RT::SystemUser->Id , "Stolen by the systemuser");
-
-=end testing
 
 =cut
 
@@ -3178,25 +2949,6 @@
 
 Alternatively, you can pass in a list of named parameters (Status => STATUS, Force => FORCE).  If FORCE is true, ignore unresolved dependencies and force a status change.
 
-=begin testing
-
-my $tt = RT::Ticket->new($RT::SystemUser);
-my ($id, $tid, $msg)= $tt->Create(Queue => 'general',
-            Subject => 'test');
-ok($id, $msg);
-is($tt->Status, 'new', "New ticket is created as new");
-
-($id, $msg) = $tt->SetStatus('open');
-ok($id, $msg);
-like($msg, qr/open/i, "Status message is correct");
-($id, $msg) = $tt->SetStatus('resolved');
-ok($id, $msg);
-like($msg, qr/resolved/i, "Status message is correct");
-($id, $msg) = $tt->SetStatus('resolved');
-ok(!$id,$msg);
-
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -70,15 +70,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok (require RT::Tickets);
-ok( my $testtickets = RT::Tickets->new( $RT::SystemUser ) );
-ok( $testtickets->LimitStatus( VALUE => 'deleted' ) );
-# Should be zero until 'allow_deleted_search'
-ok( $testtickets->Count == 0 );
-
-=end testing
 
 =cut
 
@@ -789,71 +780,6 @@
   1: Field to query on
 
 
-=begin testing
-
-# Test to make sure that you can search for tickets by requestor address and
-# by requestor name.
-
-my ($id,$msg);
-my $u1 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u1->Create( Name => 'RequestorTestOne', EmailAddress => 'rqtest1 at example.com');
-ok ($id,$msg);
-my $u2 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u2->Create( Name => 'RequestorTestTwo', EmailAddress => 'rqtest2 at example.com');
-ok ($id,$msg);
-
-my $t1 = RT::Ticket->new($RT::SystemUser);
-my ($trans);
-($id,$trans,$msg) =$t1->Create (Queue => 'general', Subject => 'Requestor test one', Requestor => [$u1->EmailAddress]);
-ok ($id, $msg);
-
-my $t2 = RT::Ticket->new($RT::SystemUser);
-($id,$trans,$msg) =$t2->Create (Queue => 'general', Subject => 'Requestor test one', Requestor => [$u2->EmailAddress]);
-ok ($id, $msg);
-
-
-my $t3 = RT::Ticket->new($RT::SystemUser);
-($id,$trans,$msg) =$t3->Create (Queue => 'general', Subject => 'Requestor test one', Requestor => [$u2->EmailAddress, $u1->EmailAddress]);
-ok ($id, $msg);
-
-
-my $tix1 = RT::Tickets->new($RT::SystemUser);
-$tix1->FromSQL('Requestor.EmailAddress LIKE "rqtest1" OR Requestor.EmailAddress LIKE "rqtest2"');
-
-is ($tix1->Count, 3);
-
-my $tix2 = RT::Tickets->new($RT::SystemUser);
-$tix2->FromSQL('Requestor.Name LIKE "TestOne" OR Requestor.Name LIKE "TestTwo"');
-
-is ($tix2->Count, 3);
-
-
-my $tix3 = RT::Tickets->new($RT::SystemUser);
-$tix3->FromSQL('Requestor.EmailAddress LIKE "rqtest1"');
-
-is ($tix3->Count, 2);
-
-my $tix4 = RT::Tickets->new($RT::SystemUser);
-$tix4->FromSQL('Requestor.Name LIKE "TestOne" ');
-
-is ($tix4->Count, 2);
-
-# Searching for tickets that have two requestors isn't supported
-# There's no way to differentiate "one requestor name that matches foo and bar"
-# and "two requestors, one matching foo and one matching bar"
-
-# my $tix5 = RT::Tickets->new($RT::SystemUser);
-# $tix5->FromSQL('Requestor.Name LIKE "TestOne" AND Requestor.Name LIKE "TestTwo"');
-# 
-# is ($tix5->Count, 1);
-# 
-# my $tix6 = RT::Tickets->new($RT::SystemUser);
-# $tix6->FromSQL('Requestor.EmailAddress LIKE "rqtest1" AND Requestor.EmailAddress LIKE "rqtest2"');
-# 
-# is ($tix6->Count, 1);
-
-
-=end testing
 
 =cut
 
@@ -2075,12 +2001,6 @@
   VALUE is a value to match the ticket\'s watcher email addresses against
   TYPE is the sort of watchers you want to match against. Leave it undef if you want to search all of them
 
-=begin testing
-
-my $t1 = RT::Ticket->new($RT::SystemUser);
-$t1->Create(Queue => 'general', Subject => "LimitWatchers test", Requestors => \['requestor1 at example.com']);
-
-=end testing
 
 =cut
 
@@ -2957,14 +2877,6 @@
 
 =cut
 
-=begin testing
-
-# We assume that we've got some tickets hanging around from before.
-ok( my $unlimittickets = RT::Tickets->new( $RT::SystemUser ) );
-ok( $unlimittickets->UnLimit );
-ok( $unlimittickets->Count > 0, "UnLimited tickets object should return tickets" );
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay_SQL.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay_SQL.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Tickets_Overlay_SQL.pm	Mon Mar  5 14:10:46 2007
@@ -269,71 +269,6 @@
 failure.
 
 
-=begin testing
-
-use RT::Tickets;
-use strict;
-
-my $tix = RT::Tickets->new($RT::SystemUser);
-{
-    my $query = "Status = 'open'";
-    my ($status, $msg)  = $tix->FromSQL($query);
-    ok ($status, "correct query") or diag("error: $msg");
-}
-
-
-my (@created,%created);
-my $string = 'subject/content SQL test';
-{
-    my $t = RT::Ticket->new($RT::SystemUser);
-    ok( $t->Create(Queue => 'General', Subject => $string), "Ticket Created");
-    $created{ $t->Id }++; push @created, $t->Id;
-}
-
-{
-    my $Message = MIME::Entity->build(
-                     Subject     => 'this is my subject',
-                     From        => 'jesse at example.com',
-                     Data        => [ $string ],
-            );
-
-    my $t = RT::Ticket->new($RT::SystemUser);
-    ok( $t->Create( Queue => 'General',
-                    Subject => 'another ticket',
-                    MIMEObj => $Message,
-                    MemberOf => $created[0]
-                  ),
-        "Ticket Created"
-    );
-    $created{ $t->Id }++; push @created, $t->Id;
-}
-
-{
-    my $query = ("Subject LIKE '$string' OR Content LIKE '$string'");
-    my ($status, $msg) = $tix->FromSQL($query);
-    ok ($status, "correct query") or diag("error: $msg");
-
-    my $count = 0;
-    while (my $tick = $tix->Next) {
-        $count++ if $created{ $tick->id };
-    }
-    is ($count, scalar @created, "number of returned tickets same as entered");
-}
-
-{
-    my $query = "id = $created[0] OR MemberOf = $created[0]";
-    my ($status, $msg) = $tix->FromSQL($query);
-    ok ($status, "correct query") or diag("error: $msg");
-
-    my $count = 0;
-    while (my $tick = $tix->Next) {
-        $count++ if $created{ $tick->id };
-    }
-    is ($count, scalar @created, "number of returned tickets same as entered");
-}
-
-
-=end testing
 
 
 =cut

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transaction_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transaction_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -63,11 +63,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok(require RT::Transaction);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transactions_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transactions_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Transactions_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok (require RT::Transactions);
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/fsck_com_rt.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/fsck_com_rt.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/fsck_com_rt.pm	Mon Mar  5 14:10:46 2007
@@ -60,21 +60,6 @@
 
 Returns the prefix for a local URI. 
 
-=begin testing
-
-use_ok("RT::URI::fsck_com_rt");
-my $uri = RT::URI::fsck_com_rt->new($RT::SystemUser);
-
-ok(ref($uri));
-
-ok (UNIVERSAL::isa($uri,RT::URI::fsck_com_rt), "It's an RT::URI::fsck_com_rt");
-
-ok ($uri->isa('RT::URI::base'), "It's an RT::URI::base");
-ok ($uri->isa('RT::Base'), "It's an RT::Base");
-
-is ($uri->LocalURIPrefix , 'fsck.com-rt://'.RT->Config->Get('Organization'));
-
-=end testing
 
 
 
@@ -111,14 +96,6 @@
 
 Returns the RT URI for a local RT::Record object
 
-=begin testing
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-$ticket->Load(1);
-my $uri = RT::URI::fsck_com_rt->new($ticket->CurrentUser);
-is($uri->LocalURIPrefix. "/ticket/1" , $uri->URIForObject($ticket));
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/t.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/t.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/URI/t.pm	Mon Mar  5 14:10:46 2007
@@ -37,20 +37,6 @@
 When handed an t: URI, figures out if it is an RT ticket.  This is an
 alternate short form of specifying a full ticket URI.
 
-=begin testing
-
-use_ok("RT::URI::t");
-my $uri = RT::URI::t->new($RT::SystemUser);
-ok(ref($uri), "URI object exists");
-
-my $uristr = "t:1";
-$uri->ParseURI($uristr);
-is(ref($uri->Object), "RT::Ticket", "Object loaded is a ticket");
-is($uri->Object->Id, 1, "Object loaded has correct ID");
-is($uri->URI, 'fsck.com-rt://'.RT->Config->Get('Organization').'/ticket/1',
-   "URI object has correct URI string");
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/User_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/User_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/User_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -57,11 +57,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok(require RT::User);
-
-=end testing
 
 
 =cut
@@ -112,55 +107,6 @@
 =head2 Create { PARAMHASH }
 
 
-=begin testing
-
-# Make sure we can create a user
-
-my $u1 = RT::User->new($RT::SystemUser);
-is(ref($u1), 'RT::User');
-my ($id, $msg) = $u1->Create(Name => 'CreateTest1'.$$, EmailAddress => $$.'create-test-1 at example.com');
-ok ($id, "Creating user CreateTest1 - " . $msg );
-
-# Make sure we can't create a second user with the same name
-my $u2 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u2->Create(Name => 'CreateTest1'.$$, EmailAddress => $$.'create-test-2 at example.com');
-ok (!$id, $msg);
-
-
-# Make sure we can't create a second user with the same EmailAddress address
-my $u3 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u3->Create(Name => 'CreateTest2'.$$, EmailAddress => $$.'create-test-1 at example.com');
-ok (!$id, $msg);
-
-# Make sure we can create a user with no EmailAddress address
-my $u4 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u4->Create(Name => 'CreateTest3'.$$);
-ok ($id, $msg);
-
-# make sure we can create a second user with no EmailAddress address
-my $u5 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u5->Create(Name => 'CreateTest4'.$$);
-ok ($id, $msg);
-
-# make sure we can create a user with a blank EmailAddress address
-my $u6 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u6->Create(Name => 'CreateTest6'.$$, EmailAddress => '');
-ok ($id, $msg);
-# make sure we can create a second user with a blankEmailAddress address
-my $u7 = RT::User->new($RT::SystemUser);
-($id, $msg) = $u7->Create(Name => 'CreateTest7'.$$, EmailAddress => '');
-ok ($id, $msg);
-
-# Can we change the email address away from from "";
-($id,$msg) = $u7->SetEmailAddress('foo at bar'.$$);
-ok ($id, $msg);
-# can we change the address back to "";  
-($id,$msg) = $u7->SetEmailAddress('');
-ok ($id, $msg);
-is ($u7->EmailAddress, '');
-
-
-=end testing
 
 =cut
 
@@ -338,20 +284,6 @@
 
 Returns a standard RT tuple of (val, msg);
 
-=begin testing
-
-
-ok(my $user = RT::User->new($RT::SystemUser));
-ok($user->Load('root'), "Loaded user 'root'");
-ok($user->Privileged, "User 'root' is privileged");
-ok(my ($v,$m) = $user->SetPrivileged(0));
-ok ($v ==1, "Set unprivileged suceeded ($m)");
-ok(!$user->Privileged, "User 'root' is no longer privileged");
-ok(my ($v2,$m2) = $user->SetPrivileged(1));
-ok ($v2 ==1, "Set privileged suceeded ($m2");
-ok($user->Privileged, "User 'root' is privileged again");
-
-=end testing
 
 =cut
 
@@ -1191,14 +1123,6 @@
 if there's no principal object matching this user. 
 The response is cached. PrincipalObj should never ever change.
 
-=begin testing
-
-ok(my $u = RT::User->new($RT::SystemUser));
-ok($u->Load(1), "Loaded the first user");
-ok($u->PrincipalObj->ObjectId == 1, "user 1 is the first principal");
-is($u->PrincipalObj->PrincipalType, 'User' , "Principal 1 is a user, not a group");
-
-=end testing
 
 =cut
 
@@ -1311,237 +1235,6 @@
 =head1 Rights testing
 
 
-=begin testing
-
-my $root = RT::User->new($RT::SystemUser);
-$root->Load('root');
-ok($root->Id, "Found the root user");
-my $rootq = RT::Queue->new($root);
-$rootq->Load(1);
-ok($rootq->Id, "Loaded the first queue");
-
-ok ($rootq->CurrentUser->HasRight(Right=> 'CreateTicket', Object => $rootq), "Root can create tickets");
-
-my $new_user = RT::User->new($RT::SystemUser);
-my ($id, $msg) = $new_user->Create(Name => 'ACLTest'.$$);
-
-ok ($id, "Created a new user for acl test $msg");
-
-my $q = RT::Queue->new($new_user);
-$q->Load(1);
-ok($q->Id, "Loaded the first queue");
-
-
-ok (!$q->CurrentUser->HasRight(Right => 'CreateTicket', Object => $q), "Some random user doesn't have the right to create tickets");
-ok (my ($gval, $gmsg) = $new_user->PrincipalObj->GrantRight( Right => 'CreateTicket', Object => $q), "Granted the random user the right to create tickets");
-ok ($gval, "Grant succeeded - $gmsg");
-
-
-ok ($q->CurrentUser->HasRight(Right => 'CreateTicket', Object => $q), "The user can create tickets after we grant him the right");
-ok (my ($gval, $gmsg) = $new_user->PrincipalObj->RevokeRight( Right => 'CreateTicket', Object => $q), "revoked the random user the right to create tickets");
-ok ($gval, "Revocation succeeded - $gmsg");
-ok (!$q->CurrentUser->HasRight(Right => 'CreateTicket', Object => $q), "The user can't create tickets anymore");
-
-
-
-
-
-# Create a ticket in the queue
-my $new_tick = RT::Ticket->new($RT::SystemUser);
-my ($tickid, $tickmsg) = $new_tick->Create(Subject=> 'ACL Test', Queue => 'General');
-ok($tickid, "Created ticket: $tickid");
-# Make sure the user doesn't have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
-# Create a new group
-my $group = RT::Group->new($RT::SystemUser);
-$group->CreateUserDefinedGroup(Name => 'ACLTest'.$$);
-ok($group->Id, "Created a new group Ok");
-# Grant a group the right to modify tickets in a queue
-ok(my ($gv,$gm) = $group->PrincipalObj->GrantRight( Object => $q, Right => 'ModifyTicket'),"Granted the group the right to modify tickets");
-ok($gv,"Grant succeeed - $gm");
-# Add the user to the group
-ok( my ($aid, $amsg) = $group->AddMember($new_user->PrincipalId), "Added the member to the group");
-ok ($aid, "Member added to group: $amsg");
-# Make sure the user does have the right to modify tickets in the queue
-ok ($new_user->HasRight( Object => $new_tick, Right => 'ModifyTicket'), "User can modify the ticket with group membership");
-
-
-# Remove the user from the group
-ok( my ($did, $dmsg) = $group->DeleteMember($new_user->PrincipalId), "Deleted the member from the group");
-ok ($did,"Deleted the group member: $dmsg");
-# Make sure the user doesn't have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
-
-
-my $q_as_system = RT::Queue->new($RT::SystemUser);
-$q_as_system->Load(1);
-ok($q_as_system->Id, "Loaded the first queue");
-
-# Create a ticket in the queue
-my $new_tick2 = RT::Ticket->new($RT::SystemUser);
-my ($tick2id, $tickmsg) = $new_tick2->Create(Subject=> 'ACL Test 2', Queue =>$q_as_system->Id);
-ok($tick2id, "Created ticket: $tick2id");
-is($new_tick2->QueueObj->id, $q_as_system->Id, "Created a new ticket in queue 1");
-
-
-# make sure that the user can't do this without subgroup membership
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
-
-# Create a subgroup
-my $subgroup = RT::Group->new($RT::SystemUser);
-$subgroup->CreateUserDefinedGroup(Name => 'Subgrouptest',$$);
-ok($subgroup->Id, "Created a new group ".$subgroup->Id."Ok");
-#Add the subgroup as a subgroup of the group
-my ($said, $samsg) =  $group->AddMember($subgroup->PrincipalId);
-ok ($said, "Added the subgroup as a member of the group");
-# Add the user to a subgroup of the group
-
-my ($usaid, $usamsg) =  $subgroup->AddMember($new_user->PrincipalId);
-ok($usaid,"Added the user ".$new_user->Id."to the subgroup");
-# Make sure the user does have the right to modify tickets in the queue
-ok ($new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can modify the ticket with subgroup membership");
-
-#  {{{ Deal with making sure that members of subgroups of a disabled group don't have rights
-
-my ($id, $msg);
-($id, $msg) =  $group->SetDisabled(1);
-ok ($id,$msg);
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket when the group ".$group->Id. " is disabled");
- ($id, $msg) =  $group->SetDisabled(0);
-ok($id,$msg);
-# Test what happens when we disable the group the user is a member of directly
-
-($id, $msg) =  $subgroup->SetDisabled(1);
- ok ($id,$msg);
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket when the group ".$subgroup->Id. " is disabled");
- ($id, $msg) =  $subgroup->SetDisabled(0);
- ok ($id,$msg);
-ok ($new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can modify the ticket without group membership");
-
-# }}}
-
-
-my ($usrid, $usrmsg) =  $subgroup->DeleteMember($new_user->PrincipalId);
-ok($usrid,"removed the user from the group - $usrmsg");
-# Make sure the user doesn't have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
-
-#revoke the right to modify tickets in a queue
-ok(($gv,$gm) = $group->PrincipalObj->RevokeRight( Object => $q, Right => 'ModifyTicket'),"Granted the group the right to modify tickets");
-ok($gv,"revoke succeeed - $gm");
-
-# {{{ Test the user's right to modify a ticket as a _queue_ admincc for a right granted at the _queue_ level
-
-# Grant queue admin cc the right to modify ticket in the queue 
-ok(my ($qv,$qm) = $q_as_system->AdminCc->PrincipalObj->GrantRight( Object => $q_as_system, Right => 'ModifyTicket'),"Granted the queue adminccs the right to modify tickets");
-ok($qv, "Granted the right successfully - $qm");
-
-# Add the user as a queue admincc
-ok ((my $add_id, $add_msg) = $q_as_system->AddWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Added the new user as a queue admincc");
-ok ($add_id, "the user is now a queue admincc - $add_msg");
-
-# Make sure the user does have the right to modify tickets in the queue
-ok ($new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can modify the ticket as an admincc");
-# Remove the user from the role  group
-ok ((my $del_id, $del_msg) = $q_as_system->DeleteWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Deleted the new user as a queue admincc");
-
-# Make sure the user doesn't have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
-
-# }}}
-
-# {{{ Test the user's right to modify a ticket as a _ticket_ admincc with the right granted at the _queue_ level
-
-# Add the user as a ticket admincc
-ok ((my $uadd_id, $uadd_msg) = $new_tick2->AddWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Added the new user as a queue admincc");
-ok ($add_id, "the user is now a queue admincc - $add_msg");
-
-# Make sure the user does have the right to modify tickets in the queue
-ok ($new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can modify the ticket as an admincc");
-
-# Remove the user from the role  group
-ok ((my $del_id, $del_msg) = $new_tick2->DeleteWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Deleted the new user as a queue admincc");
-
-# Make sure the user doesn't have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
-
-
-# Revoke the right to modify ticket in the queue 
-ok(my ($rqv,$rqm) = $q_as_system->AdminCc->PrincipalObj->RevokeRight( Object => $q_as_system, Right => 'ModifyTicket'),"Revokeed the queue adminccs the right to modify tickets");
-ok($rqv, "Revoked the right successfully - $rqm");
-
-# }}}
-
-
-
-# {{{ Test the user's right to modify a ticket as a _queue_ admincc for a right granted at the _system_ level
-
-# Before we start Make sure the user does not have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can not modify the ticket without it being granted");
-ok (!$new_user->HasRight( Object => $new_tick2->QueueObj, Right => 'ModifyTicket'), "User can not modify tickets in the queue without it being granted");
-
-# Grant queue admin cc the right to modify ticket in the queue 
-ok(my ($qv,$qm) = $q_as_system->AdminCc->PrincipalObj->GrantRight( Object => $RT::System, Right => 'ModifyTicket'),"Granted the queue adminccs the right to modify tickets");
-ok($qv, "Granted the right successfully - $qm");
-
-# Make sure the user can't modify the ticket before they're added as a watcher
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can not modify the ticket without being an admincc");
-ok (!$new_user->HasRight( Object => $new_tick2->QueueObj, Right => 'ModifyTicket'), "User can not modify tickets in the queue without being an admincc");
-
-# Add the user as a queue admincc
-ok ((my $add_id, $add_msg) = $q_as_system->AddWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Added the new user as a queue admincc");
-ok ($add_id, "the user is now a queue admincc - $add_msg");
-
-# Make sure the user does have the right to modify tickets in the queue
-ok ($new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can modify the ticket as an admincc");
-ok ($new_user->HasRight( Object => $new_tick2->QueueObj, Right => 'ModifyTicket'), "User can modify tickets in the queue as an admincc");
-# Remove the user from the role  group
-ok ((my $del_id, $del_msg) = $q_as_system->DeleteWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Deleted the new user as a queue admincc");
-
-# Make sure the user doesn't have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket without group membership");
-ok (!$new_user->HasRight( Object => $new_tick2->QueueObj, Right => 'ModifyTicket'), "User can't modify tickets in the queue without group membership");
-
-# }}}
-
-# {{{ Test the user's right to modify a ticket as a _ticket_ admincc with the right granted at the _queue_ level
-
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can not modify the ticket without being an admincc");
-ok (!$new_user->HasRight( Object => $new_tick2->QueueObj, Right => 'ModifyTicket'), "User can not modify tickets in the queue obj without being an admincc");
-
-
-# Add the user as a ticket admincc
-ok ((my $uadd_id, $uadd_msg) = $new_tick2->AddWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Added the new user as a queue admincc");
-ok ($add_id, "the user is now a queue admincc - $add_msg");
-
-# Make sure the user does have the right to modify tickets in the queue
-ok ($new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can modify the ticket as an admincc");
-ok (!$new_user->HasRight( Object => $new_tick2->QueueObj, Right => 'ModifyTicket'), "User can not modify tickets in the queue obj being only a ticket admincc");
-
-# Remove the user from the role  group
-ok ((my $del_id, $del_msg) = $new_tick2->DeleteWatcher(Type => 'AdminCc', PrincipalId => $new_user->PrincipalId)  , "Deleted the new user as a queue admincc");
-
-# Make sure the user doesn't have the right to modify tickets in the queue
-ok (!$new_user->HasRight( Object => $new_tick2, Right => 'ModifyTicket'), "User can't modify the ticket without being an admincc");
-ok (!$new_user->HasRight( Object => $new_tick2->QueueObj, Right => 'ModifyTicket'), "User can not modify tickets in the queue obj without being an admincc");
-
-
-# Revoke the right to modify ticket in the queue 
-ok(my ($rqv,$rqm) = $q_as_system->AdminCc->PrincipalObj->RevokeRight( Object => $RT::System, Right => 'ModifyTicket'),"Revokeed the queue adminccs the right to modify tickets");
-ok($rqv, "Revoked the right successfully - $rqm");
-
-# }}}
-
-
-
-
-# Grant "privileged users" the system right to create users
-# Create a privileged user.
-# have that user create another user
-# Revoke the right for privileged users to create users
-# have the privileged user try to create another user and fail the ACL check
-
-=end testing
 
 =cut
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Users_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Users_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Users_Overlay.pm	Mon Mar  5 14:10:46 2007
@@ -58,11 +58,6 @@
 
 =head1 METHODS
 
-=begin testing
-
-ok(require RT::Users);
-
-=end testing
 
 =cut
 
@@ -231,68 +226,6 @@
 
 =head2 WhoHaveRight { Right => 'name', Object => $rt_object , IncludeSuperusers => undef, IncludeSubgroupMembers => undef, IncludeSystemRights => undef, EquivObjects => [ ] }
 
-=begin testing
-
-ok(my $users = RT::Users->new($RT::SystemUser));
-$users->WhoHaveRight(Object =>$RT::System, Right =>'SuperUser');
-ok($users->Count == 1, "There is one privileged superuser - Found ". $users->Count );
-# TODO: this wants more testing
-
-my $RTxUser = RT::User->new($RT::SystemUser);
-($id, $msg) = $RTxUser->Create( Name => 'RTxUser', Comments => "RTx extension user", Privileged => 1);
-ok ($id,$msg);
-
-my $group = RT::Group->new($RT::SystemUser);
-$group->LoadACLEquivalenceGroup($RTxUser->PrincipalObj);
-
-my $RTxSysObj = {};
-bless $RTxSysObj, 'RTx::System';
-*RTx::System::Id = sub { 1; };
-*RTx::System::id = *RTx::System::Id;
-my $ace = RT::Record->new($RT::SystemUser);
-$ace->Table('ACL');
-$ace->_BuildTableAttributes unless ($_TABLE_ATTR->{ref($self)});
-($id, $msg) = $ace->Create( PrincipalId => $group->id, PrincipalType => 'Group', RightName => 'RTxUserRight', ObjectType => 'RTx::System', ObjectId  => 1 );
-ok ($id, "ACL for RTxSysObj created");
-
-my $RTxObj = {};
-bless $RTxObj, 'RTx::System::Record';
-*RTx::System::Record::Id = sub { 4; };
-*RTx::System::Record::id = *RTx::System::Record::Id;
-
-$users = RT::Users->new($RT::SystemUser);
-$users->WhoHaveRight(Right => 'RTxUserRight', Object => $RTxSysObj);
-is($users->Count, 1, "RTxUserRight found for RTxSysObj");
-
-$users = RT::Users->new($RT::SystemUser);
-$users->WhoHaveRight(Right => 'RTxUserRight', Object => $RTxObj);
-is($users->Count, 0, "RTxUserRight not found for RTxObj");
-
-$users = RT::Users->new($RT::SystemUser);
-$users->WhoHaveRight(Right => 'RTxUserRight', Object => $RTxObj, EquivObjects => [ $RTxSysObj ]);
-is($users->Count, 1, "RTxUserRight found for RTxObj using EquivObjects");
-
-$ace = RT::Record->new($RT::SystemUser);
-$ace->Table('ACL');
-$ace->_BuildTableAttributes unless ($_TABLE_ATTR->{ref($self)});
-($id, $msg) = $ace->Create( PrincipalId => $group->id, PrincipalType => 'Group', RightName => 'RTxUserRight', ObjectType => 'RTx::System::Record', ObjectId => 5 );
-ok ($id, "ACL for RTxObj created");
-
-my $RTxObj2 = {};
-bless $RTxObj2, 'RTx::System::Record';
-*RTx::System::Record::Id = sub { 5; };
-*RTx::System::Record::id = sub { 5; };
-
-$users = RT::Users->new($RT::SystemUser);
-$users->WhoHaveRight(Right => 'RTxUserRight', Object => $RTxObj2);
-is($users->Count, 1, "RTxUserRight found for RTxObj2");
-
-$users = RT::Users->new($RT::SystemUser);
-$users->WhoHaveRight(Right => 'RTxUserRight', Object => $RTxObj2, EquivObjects => [ $RTxSysObj ]);
-is($users->Count, 1, "RTxUserRight found for RTxObj2");
-
-
-=end testing
 
 find all users who the right Right for this group, either individually
 or as members of groups


More information about the Rt-commit mailing list