[Rt-commit] r7937 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: . t/api t/ordered-1 t/ordered-2 t/ticket

clsung at bestpractical.com clsung at bestpractical.com
Sat May 26 02:58:10 EDT 2007


Author: clsung
Date: Sat May 26 02:58:09 2007
New Revision: 7937

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/action-createtickets.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/attribute.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/customfield.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/group.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/groups.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/i18n.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/queue.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/record.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/rt.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip_order.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/ticket.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/tickets.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/user.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/users.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-1/0query_builder.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-2/0acl.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ticket/linking.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/compilation_errors.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/rights.t

Log:
 r10797 at going04:  clsung | 2007-05-26 12:02:43 +0800
 - number of test should be 14 instead of 15
 r10798 at going04:  clsung | 2007-05-26 13:23:38 +0800
 - ok ( =~ ) to like ( , )
 - ok ( == ) to is ( , )
 - ok ( eq ) to is ( , )
 - ok ( != ) to isnt ( , )
 - ok ( ne ) to isnt ( , )
 r10799 at going04:  clsung | 2007-05-26 14:57:23 +0800
 - ok => is/isnt


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/action-createtickets.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/action-createtickets.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/action-createtickets.t	Sat May 26 02:58:09 2007
@@ -47,7 +47,7 @@
 ENDOFCONTENT
 ';
 
-ok ($approvals =~ /Content/, "Read in the approvals template");
+like ($approvals , qr/Content/, "Read in the approvals template");
 
 my $apptemp = RT::Template->new($RT::SystemUser);
 $apptemp->Create( Content => $approvals, Name => "Approvals", Queue => "0");

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/attribute.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/attribute.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/attribute.t	Sat May 26 02:58:09 2007
@@ -16,7 +16,7 @@
 ok ($id, $msg);
 my $attr = RT::Attribute->new($RT::SystemUser);
 $attr->Load($id);
-ok($attr->Name eq 'SavedSearch');
+is($attr->Name , 'SavedSearch');
 $attr->SetSubValues( Format => 'baz');
 
 my $format = $attr->SubValue('Format');

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/customfield.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/customfield.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/customfield.t	Sat May 26 02:58:09 2007
@@ -18,7 +18,7 @@
                                  SortOrder => '1',
                                  Description => 'A Testing custom field',
                                  Type=> 'SelectSingle'), 'Created a global CustomField');
-ok($id != 0, 'Global custom field correctly created');
+isnt($id , 0, 'Global custom field correctly created');
 ok ($cf->SingleValue);
 is($cf->Type, 'Select');
 is($cf->MaxValues, 1);
@@ -29,7 +29,7 @@
 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");
+is($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',
@@ -37,7 +37,7 @@
                                  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 ');
+is($bad_id , 0, 'Global custom field correctly decided to not create a cf with a bogus type ');
 
 
     undef $main::_STDOUT_;
@@ -50,9 +50,9 @@
 
 ok(my $cf = RT::CustomField->new($RT::SystemUser));
 $cf->Load(1);
-ok($cf->Id == 1);
+is($cf->Id , 1);
 ok(my ($val,$msg)  = $cf->AddValue(Name => 'foo' , Description => 'TestCFValue', SortOrder => '6'));
-ok($val != 0);
+isnt($val , 0);
 ok (my ($delval, $delmsg) = $cf->DeleteValue($val));
 ok ($delval,"Deleting a cf value: $delmsg");
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/group.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/group.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/group.t	Sat May 26 02:58:09 2007
@@ -17,12 +17,12 @@
 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'");
+isnt ($id , 0, "Group id is $id");
+is ($group->Name , '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");
+is($ng->id , $group->id, "Loaded the right group");
 
 
 ok (($id,$msg) = $ng->AddMember('1'), "Added a member to the group");
@@ -36,7 +36,7 @@
 
 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 ");
+isnt ($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");
@@ -46,7 +46,7 @@
 
 my $group_3 = RT::Group->new($RT::SystemUser);
 ok (my ($id_3, $msg_3) = $group_3->CreateUserDefinedGroup( Name => 'TestGroup3', Description => 'A second test group'), 'Created a new group');
-ok ($id_3 != 0, "Created group 3 ok - $msg_3");
+isnt ($id_3 , 0, "Created group 3 ok - $msg_3");
 ok (($id,$msg) =$group_3->AddMember($group_2->PrincipalId), "Made TestGroup a member of testgroup2");
 ok($id, $msg);
 
@@ -67,7 +67,7 @@
 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);
+isnt ($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.
@@ -98,8 +98,8 @@
 
 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");
+is($u->PrincipalObj->ObjectId , 4, "user 4 is the fourth principal");
+is($u->PrincipalObj->PrincipalType , 'Group' , "Principal 4 is a group");
 
 
     undef $main::_STDOUT_;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/groups.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/groups.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/groups.t	Sat May 26 02:58:09 2007
@@ -58,8 +58,8 @@
 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");
+is ($groups->Count , 1,"found the 1 group - " . $groups->Count);
+is ($groups->First->Id , $g->Id, "it's the right one");
 
 
     undef $main::_STDOUT_;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/i18n.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/i18n.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/i18n.t	Sat May 26 02:58:09 2007
@@ -25,12 +25,12 @@
 
 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);
+like($chinese->maketext('__Content-Type') , qr/utf-8/i, "Found the utf-8 charset for traditional chinese in the string ".$chinese->maketext('__Content-Type'));
+is($chinese->encoding , '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'");
+is($en->encoding , 'utf-8', "The encoding ".$en->encoding." is 'utf-8'");
 
 
     undef $main::_STDOUT_;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/queue.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/queue.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/queue.t	Sat May 26 02:58:09 2007
@@ -23,8 +23,8 @@
     undef $main::_STDERR_;
 
 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');
+is($q->IsValidStatus('new'), 1, 'New is a valid status');
+is($q->IsValidStatus('f00'), 0, 'f00 is not a valid status');
 
 
     undef $main::_STDOUT_;
@@ -36,9 +36,9 @@
     undef $main::_STDERR_;
 
 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');
+is($q->IsActiveStatus('new'), 1, 'New is a Active status');
+is($q->IsActiveStatus('rejected'), 0, 'Rejected is an inactive status');
+is($q->IsActiveStatus('f00'), 0, 'f00 is not a Active status');
 
 
     undef $main::_STDOUT_;
@@ -50,9 +50,9 @@
     undef $main::_STDERR_;
 
 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');
+is($q->IsInactiveStatus('new'), 0, 'New is a Active status');
+is($q->IsInactiveStatus('rejected'), 1, 'rejeected is an Inactive status');
+is($q->IsInactiveStatus('f00'), 0, 'f00 is not a Active status');
 
 
     undef $main::_STDOUT_;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/record.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/record.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/record.t	Sat May 26 02:58:09 2007
@@ -55,8 +55,8 @@
 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");
+is ($link->LocalTarget , $t3->id, "Link LocalTarget is correct");
+is ($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");

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/rt.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/rt.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/rt.t	Sat May 26 02:58:09 2007
@@ -11,10 +11,10 @@
     undef $main::_STDOUT_;
     undef $main::_STDERR_;
 
-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");
+is ($RT::Nobody->Name() , 'Nobody', "Nobody is nobody");
+isnt ($RT::Nobody->Name() , 'root', "Nobody isn't named root");
+is ($RT::SystemUser->Name() , 'RT_System', "The system user is RT_System");
+isnt ($RT::SystemUser->Name() , 'noname', "The system user isn't noname");
 
 
     undef $main::_STDOUT_;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip.t	Sat May 26 02:58:09 2007
@@ -35,7 +35,7 @@
                                     );
 ok($tv, $tm);
 
-ok ($ticket->Priority == '87', "Ticket priority is set right");
+is ($ticket->Priority , '87', "Ticket priority is set right");
 
 
 my $ticket2 = RT::Ticket->new($RT::SystemUser);
@@ -44,7 +44,7 @@
                                     );
 ok($t2v, $t2m);
 
-ok ($ticket2->Priority != '87', "Ticket priority is set right");
+isnt ($ticket2->Priority , '87', "Ticket priority is set right");
 
 
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip_order.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip_order.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/scrip_order.t	Sat May 26 02:58:09 2007
@@ -48,9 +48,9 @@
 );
 ok($ticket->id, "Created ticket? id=$id");
 
-ok($ticket->Priority != 0, "Ticket shouldn't be priority 0");
-ok($ticket->Priority != 5, "Ticket shouldn't be priority 5");
-ok($ticket->Priority == 10, "Ticket should be priority 10");
+isnt($ticket->Priority , 0, "Ticket shouldn't be priority 0");
+isnt($ticket->Priority , 5, "Ticket shouldn't be priority 5");
+is  ($ticket->Priority , 10, "Ticket should be priority 10");
 
 # }}}
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/ticket.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/ticket.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/ticket.t	Sat May 26 02:58:09 2007
@@ -15,7 +15,7 @@
 use_ok ('RT::Queue');
 ok(my $testqueue = RT::Queue->new($RT::SystemUser));
 ok($testqueue->Create( Name => 'ticket tests'));
-ok($testqueue->Id != 0);
+isnt($testqueue->Id , 0);
 use_ok('RT::CustomField');
 ok(my $testcf = RT::CustomField->new($RT::SystemUser));
 my ($ret, $cmsg) = $testcf->Create( Name => 'selectmulti',
@@ -35,7 +35,7 @@
                         SortOrder => '3',
                         Description => 'Yet Another testing value'));
                        
-ok($testcf->Values->Count == 3);
+is($testcf->Values->Count , 3);
 
 use_ok('RT::Ticket');
 
@@ -47,25 +47,25 @@
                Subject => 'Testing',
                Owner => $u->Id
               ));
-ok($id != 0);
-ok ($t->OwnerObj->Id == $u->Id, "Root is the ticket owner");
+isnt($id , 0);
+is ($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);
+isnt($cfv , 0, "Custom field creation didn't return an error: $cfm");
+is($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);
+isnt ($cfdv , 0, "Deleted a custom field value: $cfdm");
+is($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);
+is($t2->OwnerObj->Id, $u->Id);
 
 my $t3 = RT::Ticket->new($RT::SystemUser);
 my ($id3, $msg3) = $t3->Create( Queue => $testqueue->Id,
@@ -73,16 +73,16 @@
                                 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");
+isnt($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");
+isnt($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,
+isnt($cfv3 , 0, "Adding a custom field to ticket 1 is successful: $cfm");
+is($t->CustomFieldValues($testcf->Id)->Count , 2,
    "This ticket has 2 custom field values");
-ok($t3->CustomFieldValues($testcf->Id)->Count == 1,
+is($t3->CustomFieldValues($testcf->Id)->Count , 1,
    "This ticket has 1 custom field value");
 
 
@@ -111,8 +111,8 @@
 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");
+like ($t->RefersTo->First->Target , qr/fsck.com/, "Got refers to");
+like ($t->ReferredToBy->First->Base , qr/cpan.org/, "Got referredtoby");
 is ($t->ResolvedObj->Unix, 0, "It hasn't been resolved - ". $t->ResolvedObj->Unix);
 
 
@@ -249,8 +249,8 @@
 $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");
+is($steal->OldValue , $root->Id , "Stolen from root");
+is($steal->NewValue , $RT::SystemUser->Id , "Stolen by the systemuser");
 
 
     undef $main::_STDOUT_;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/tickets.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/tickets.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/tickets.t	Sat May 26 02:58:09 2007
@@ -15,7 +15,7 @@
 ok( my $testtickets = RT::Tickets->new( $RT::SystemUser ) );
 ok( $testtickets->LimitStatus( VALUE => 'deleted' ) );
 # Should be zero until 'allow_deleted_search'
-ok( $testtickets->Count == 0 );
+is( $testtickets->Count , 0 );
 
 
     undef $main::_STDOUT_;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/user.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/user.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/user.t	Sat May 26 02:58:09 2007
@@ -82,10 +82,10 @@
 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)");
+is ($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");
+is ($v2 ,1, "Set privileged suceeded ($m2");
 ok($user->Privileged, "User 'root' is privileged again");
 
 
@@ -99,7 +99,7 @@
 
 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->ObjectId , 1, "user 1 is the first principal");
 is($u->PrincipalObj->PrincipalType, 'User' , "Principal 1 is a user, not a group");
 
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/users.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/users.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/users.t	Sat May 26 02:58:09 2007
@@ -24,7 +24,7 @@
 
 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 );
+is($users->Count , 1, "There is one privileged superuser - Found ". $users->Count );
 # TODO: this wants more testing
 
 my $RTxUser = RT::User->new($RT::SystemUser);

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-1/0query_builder.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-1/0query_builder.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-1/0query_builder.t	Sat May 26 02:58:09 2007
@@ -42,13 +42,13 @@
 ok($agent->{form}->find_input('user'));
 
 ok($agent->{form}->find_input('pass'));
-ok ($agent->{'content'} =~ /username:/i);
+like ($agent->{'content'} , qr/username:/i);
 $agent->field( 'user' => 'root' );
 $agent->field( 'pass' => 'password' );
 # the field isn't named, so we have to click link 0
 $agent->click(0);
 is($agent->{'status'}, 200, "Fetched the page ok");
-ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
+like( $agent->{'content'} , qr/Logout/i, "Found a logout link");
 
 # }}}
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-2/0acl.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-2/0acl.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ordered-2/0acl.t	Sat May 26 02:58:09 2007
@@ -43,7 +43,7 @@
 
 $agent->reload;
 
-ok($agent->{'content'} =~ /Logout/i, "Reloaded page successfully");
+like($agent->{'content'} , qr/Logout/i, "Reloaded page successfully");
 ok($agent->find_link( url => "$RT::WebPath/Admin/",
 		       text => 'Configuration'), "Found config tab" );
 my ($revokeid,$revokemsg) =$user_obj->PrincipalObj->RevokeRight(Right => 'ShowConfigTab');
@@ -51,7 +51,7 @@
 ($grantid,$grantmsg) =$user_obj->PrincipalObj->GrantRight(Right => 'ModifySelf');
 ok ($grantid,$grantmsg);
 $agent->reload();
-ok($agent->{'content'} =~ /Logout/i, "Reloaded page successfully");
+like($agent->{'content'} , qr/Logout/i, "Reloaded page successfully");
 ok($agent->find_link( url => "$RT::WebPath/User/Prefs.html",
 		       text => 'Preferences'), "Found prefs pane" );
 ($revokeid,$revokemsg) = $user_obj->PrincipalObj->RevokeRight(Right => 'ModifySelf');
@@ -66,16 +66,16 @@
 ($grantid,$grantmsg) = $user_obj->PrincipalObj->GrantRight(Right => 'LoadSavedSearch');
 ok($grantid,$grantmsg);
 $agent->reload();
-ok($agent->{'content'} =~ /Load saved search/i, "Search loading box exists");
+like($agent->{'content'} , qr/Load saved search/i, "Search loading box exists");
 ok($agent->{'content'} !~ /input\s+type=.submit.\s+name=.Save./i, 
    "Still no saved searches box");
 
 ($grantid,$grantmsg) =$user_obj->PrincipalObj->GrantRight(Right => 'CreateSavedSearch');
 ok ($grantid,$grantmsg);
 $agent->reload();
-ok($agent->{'content'} =~ /Load saved search/i, 
+like($agent->{'content'} , qr/Load saved search/i, 
    "Search loading box still exists");
-ok($agent->{'content'} =~ /input\s+type=.submit.\s+name=.Save./i, 
+like($agent->{'content'} , qr/input\s+type=.submit.\s+name=.Save./i, 
    "Saved searches box exists");
 
 # Create a group, and a queue, so we can test limited user visibility
@@ -123,13 +123,13 @@
     ok( $agent->{form}->find_input('user') );
 
     ok( $agent->{form}->find_input('pass') );
-    ok( $agent->{'content'} =~ /username:/i );
+    like( $agent->{'content'} , qr/username:/i );
     $agent->field( 'user' => $user_obj->Name );
     $agent->field( 'pass' => 'customer' );
 
     # the field isn't named, so we have to click link 0
     $agent->click(0);
     is( $agent->{'status'}, 200, "Fetched the page ok" );
-    ok( $agent->{'content'} =~ /Logout/i, "Found a logout link" );
+    like( $agent->{'content'} , qr/Logout/i, "Found a logout link" );
 }
 1;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ticket/linking.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ticket/linking.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/ticket/linking.t	Sat May 26 02:58:09 2007
@@ -224,8 +224,8 @@
 my $transactions = $ticket2->Transactions;
 $transactions->Limit( FIELD => 'Type', VALUE => 'AddLink' );
 is( $transactions->Count, 1, "Transaction found in other ticket" );
-ok( $transactions->First->Field eq 'ReferredToBy');
-ok( $transactions->First->NewValue eq $ticket->URI );
+is( $transactions->First->Field , 'ReferredToBy');
+is( $transactions->First->NewValue , $ticket->URI );
 
 ($id,$msg) = $ticket->DeleteLink(Type => 'RefersTo', Target => $ticket2->id);
 ok($id,$msg);
@@ -233,8 +233,8 @@
 $transactions = $ticket2->Transactions;
 $transactions->Limit( FIELD => 'Type', VALUE => 'DeleteLink' );
 is( $transactions->Count, 1, "Transaction found in other ticket" );
-ok( $transactions->First->Field eq 'ReferredToBy');
-ok( $transactions->First->OldValue eq $ticket->URI );
+is( $transactions->First->Field , 'ReferredToBy');
+is( $transactions->First->OldValue , $ticket->URI );
 
 RT->Config->Set( LinkTransactionsRun1Scrip => 0 );
 

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/compilation_errors.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/compilation_errors.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/compilation_errors.t	Sat May 26 02:58:09 2007
@@ -30,13 +30,13 @@
 ok($agent->{form}->find_input('user'));
 
 ok($agent->{form}->find_input('pass'));
-ok ($agent->{'content'} =~ /username:/i);
+like ($agent->{'content'} , qr/username:/i);
 $agent->field( 'user' => 'root' );
 $agent->field( 'pass' => 'password' );
 # the field isn't named, so we have to click link 0
 $agent->click(0);
 is($agent->{'status'}, 200, "Fetched the page ok");
-ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
+like( $agent->{'content'} , qr/Logout/i, "Found a logout link");
 
 
 use File::Find;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/rights.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/rights.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/rights.t	Sat May 26 02:58:09 2007
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 15;
+use Test::More tests => 14;
 use RT::Test;
 my ($baseurl, $m) = RT::Test->started_ok;
 use constant BaseURL => "http://localhost:".RT->Config->Get('WebPort').RT->Config->Get('WebPath')."/";


More information about the Rt-commit mailing list