[Rt-commit] r7808 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: . t/api t/web

clsung at bestpractical.com clsung at bestpractical.com
Thu May 10 05:53:36 EDT 2007


Author: clsung
Date: Thu May 10 05:53:35 2007
New Revision: 7808

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/currentuser.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/record.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-fsck_com_rt.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-t.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/user.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/savedsearch.t
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/basic.t

Log:
 r1034 at going04:  clsung | 2007-05-10 17:16:06 +0800
 - fix [warning]: "my" variable $msg masks earlier declaration in same scope at t/api/customfield.t line 25
 r1035 at going04:  clsung | 2007-05-10 17:18:32 +0800
 - fix [warning]: "my" variable $XXXXX masks earlier declaration in same scope
 r1036 at going04:  clsung | 2007-05-10 17:26:30 +0800
 - all about 'earlier declaration in same scope'
 r1037 at going04:  clsung | 2007-05-10 17:26:53 +0800
 - all about 'earlier declaration in same scope'
 r1038 at going04:  clsung | 2007-05-10 17:39:34 +0800
 - fix [warning]: "my" variable $uri masks earlier declaration in same scope
 r1039 at going04:  clsung | 2007-05-10 17:50:02 +0800
 - ok (xxx != undef) => isnt (xxx, undef)
 - ok (xxx == undef) => is (xxx, undef)


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/currentuser.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/currentuser.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/currentuser.t	Thu May 10 05:53:35 2007
@@ -23,7 +23,7 @@
 
 ok (my $cu = RT::CurrentUser->new('root'));
 ok (my $lh = $cu->LanguageHandle('en-us'));
-ok ($lh != undef);
+isnt ($lh, undef, '$lh is defined');
 ok ($lh->isa('Locale::Maketext'));
 is ($cu->loc('TEST_STRING'), "Concrete Mixer", "Localized TEST_STRING into English");
 SKIP: {

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	Thu May 10 05:53:35 2007
@@ -22,7 +22,7 @@
 is($cf->Type, 'Select');
 is($cf->MaxValues, 1);
 
-my ($val, $msg) = $cf->SetMaxValues('0');
+(my $val, $msg) = $cf->SetMaxValues('0');
 ok($val, $msg);
 is($cf->Type, 'Select');
 is($cf->MaxValues, 0);

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	Thu May 10 05:53:35 2007
@@ -44,8 +44,8 @@
 # Group 2 how has 1, g1->{1, 2,3}
 
 my $group_3 = RT::Group->new($RT::SystemUser);
-ok (my ($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 (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");
 ok (($id,$msg) =$group_3->AddMember($group_2->PrincipalId), "Made TestGroup a member of testgroup2");
 ok($id, $msg);
 
@@ -62,7 +62,7 @@
 
 # g3 now has 1, g2->{1, g1->{1,2,3}}
 
-ok($group_3->HasMember($principal_2) == undef, "group 3 doesn't have member 2");
+is($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);
@@ -79,10 +79,10 @@
 # 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");
+is($group_3->HasMemberRecursively($principal_2), undef, "group 3 doesn't have member 2");
+is($group_2->HasMemberRecursively($principal_2), undef, "group 2 doesn't have member 2");
+is($ng->HasMember($principal_2), undef, "group 1 doesn't have member 2");;
+is($group_3->HasMemberRecursively($principal_2), undef, "group 3 has member 2 recursively");
 
 # }}}
 

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	Thu May 10 05:53:35 2007
@@ -40,10 +40,10 @@
 ok($id, "Created dep test 1 - $msg");
 
 my $t2 = RT::Ticket->new($RT::SystemUser);
-my ($id2, $trans, $msg2) = $t2->Create(Subject => 'DepTest2', Queue => 'general');
+(my $id2, $trans, my $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');
+(my $id3, $trans, my $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));
@@ -52,7 +52,7 @@
 
 ok ($addid, $addmsg);
 my $link = RT::Link->new($RT::SystemUser);
-my ($rv, $msg) = $link->Load($addid);
+(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");

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-fsck_com_rt.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-fsck_com_rt.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-fsck_com_rt.t	Thu May 10 05:53:35 2007
@@ -8,7 +8,6 @@
 my $uri = RT::URI::fsck_com_rt->new($RT::SystemUser);
 
 my $t1 = RT::Ticket->new($RT::SystemUser);
-my ($trans);
 my ($id,$trans,$msg) =$t1->Create (Queue => 'general', Subject => 'Requestor test one', );
 ok ($id, $msg);
 
@@ -24,7 +23,7 @@
 
 my $ticket = RT::Ticket->new($RT::SystemUser);
 $ticket->Load(1);
-my $uri = RT::URI::fsck_com_rt->new($ticket->CurrentUser);
+$uri = RT::URI::fsck_com_rt->new($ticket->CurrentUser);
 is($uri->LocalURIPrefix. "/ticket/1" , $uri->URIForObject($ticket));
 
 1;

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-t.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-t.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/uri-t.t	Thu May 10 05:53:35 2007
@@ -5,7 +5,6 @@
 use RT::Test;
 
 my $t1 = RT::Ticket->new($RT::SystemUser);
-my ($trans);
 my ($id,$trans,$msg) =$t1->Create (Queue => 'general', Subject => 'Requestor test one', );
 ok ($id, $msg);
 

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	Thu May 10 05:53:35 2007
@@ -135,7 +135,7 @@
 
 
 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, $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");
 
@@ -176,7 +176,7 @@
 
 # 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);
+(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");
 
@@ -200,7 +200,6 @@
 
 #  {{{ 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");
@@ -278,7 +277,7 @@
 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,$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
@@ -286,14 +285,14 @@
 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, $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");
+ok (($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");
@@ -324,7 +323,7 @@
 
 
 # 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,$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");
 
 # }}}

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/savedsearch.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/savedsearch.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/savedsearch.t	Thu May 10 05:53:35 2007
@@ -67,7 +67,6 @@
 \'<small>__LastUpdatedRelative__</small>\',
 \'<small>__TimeLeft__</small>\'';
 
-my ($ret, $msg);
 my $mysearch = RT::SavedSearch->new($curruser);
 ($ret, $msg) = $mysearch->Save(Privacy => 'RT::User-' . $searchuser->Id,
 			       Type => 'Ticket',

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/basic.t
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/basic.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/web/basic.t	Thu May 10 05:53:35 2007
@@ -57,7 +57,7 @@
 is ($agent->{'status'}, 200, "Loaded Create.html");
 $agent->form_number(3);
 # Start with a string containing characters in latin1
-my $string = "I18N Web Testing æøå";
+$string = "I18N Web Testing æøå";
 Encode::from_to($string, 'iso-8859-1', 'utf8');
 $agent->field('Subject' => $string);
 $agent->field('Content' => "Ticket with utf8 subject");


More information about the Rt-commit mailing list