[Rt-commit] r15378 - in rt/branches/3.999-DANGEROUS: . t/api t/maildigest t/web
jesse at bestpractical.com
jesse at bestpractical.com
Fri Aug 22 14:43:25 EDT 2008
Author: jesse
Date: Fri Aug 22 14:43:25 2008
New Revision: 15378
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/t/api/reminders.t
rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t
rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t
rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t
rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t
rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t
rt/branches/3.999-DANGEROUS/t/ticket/search_by_links.t
rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t
rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t
rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t
rt/branches/3.999-DANGEROUS/t/web/cf_access.t
rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t
rt/branches/3.999-DANGEROUS/t/web/cf_select_one.t
rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t
Log:
r44031 at 68-246-31-102: jesse | 2008-08-22 14:42:30 -0400
* more test files pass
Modified: rt/branches/3.999-DANGEROUS/t/api/reminders.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/api/reminders.t (original)
+++ rt/branches/3.999-DANGEROUS/t/api/reminders.t Fri Aug 22 14:43:25 2008
@@ -13,10 +13,10 @@
use_ok ('RT::Model::Queue');
ok(my $testqueue = RT::Model::Queue->new(current_user => RT->system_user), 'Instantiate RT::Model::Queue');
-ok($testqueue->create( Name => 'reminders tests'), 'Create new queue: reminders tests');
+ok($testqueue->create( name => 'reminders tests'), 'Create new queue: reminders tests');
isnt($testqueue->Id , 0, 'Success creating queue');
-ok($testqueue->create( Name => 'reminders tests 2'), 'Create new queue: reminders tests 2');
+ok($testqueue->create( name => 'reminders tests 2'), 'Create new queue: reminders tests 2');
isnt($testqueue->Id , 0, 'Success creating queue');
# Create test ticket
@@ -45,7 +45,7 @@
my $reminders = $t->Reminders->Collection;
ok($reminders, 'Loading reminders for this ticket');
my $found = 0;
-while ( my $reminder = $reminders->Next ) {
+while ( my $reminder = $reminders->next ) {
next unless $found == 0;
$found = 1 if ( $reminder->Subject =~ m/TestReminder/ );
}
@@ -62,7 +62,7 @@
ok($reminders, 'Loading reminders for this ticket');
$found = 0;
my $ok_queue = 0;
-while ( my $reminder = $reminders->Next ) {
+while ( my $reminder = $reminders->next ) {
next unless $found == 0;
if ( $reminder->Subject =~ m/TestReminder/ ) {
$found = 1;
@@ -75,7 +75,7 @@
# Resolve reminder
my $r_resolved = 0;
-while ( my $reminder = $reminders->Next ) {
+while ( my $reminder = $reminders->next ) {
if ( $reminder->Subject =~ m/TestReminder/ ) {
if ( $reminder->Status ne 'resolved' ) {
$t->Reminders->Resolve($reminder);
Modified: rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t (original)
+++ rt/branches/3.999-DANGEROUS/t/maildigest/attributes.t Fri Aug 22 14:43:25 2008
@@ -40,7 +40,7 @@
# Make a testing queue for ourselves.
my $testq = RT::Model::Queue->new(current_user => RT->system_user );
if( $testq->ValidateName( 'EmailDigest-testqueue' ) ) {
- ( $ret, $msg ) = $testq->create( Name => 'EmailDigest-testqueue' );
+ ( $ret, $msg ) = $testq->create( name => 'EmailDigest-testqueue' );
ok( $ret, "Our test queue is created: $msg" );
} else {
$testq->Load( 'EmailDigest-testqueue' );
@@ -61,7 +61,7 @@
Object => $testq );
ok( $ret || $msg =~ /already has/, "Granted dduser AdminQueue on testq: $msg" );
( $ret, $msg ) = $testq->AddWatcher( Type => 'AdminCc',
- PrincipalId => $user_d->principal_object->id );
+ principal_id => $user_d->principal_object->id );
ok( $ret || $msg =~ /already/, "dduser added as a queue watcher: $msg" );
# Give the others queue rights.
@@ -86,10 +86,10 @@
# Make the other users ticket watchers.
( $ret, $msg ) = $ticket->AddWatcher( Type => 'Cc',
- PrincipalId => $user_n->principal_object->id );
+ principal_id => $user_n->principal_object->id );
ok( $ret, "Added user_w as a ticket watcher: $msg" );
( $ret, $msg ) = $ticket->AddWatcher( Type => 'Cc',
- PrincipalId => $user_s->principal_object->id );
+ principal_id => $user_s->principal_object->id );
ok( $ret, "Added user_s as a ticket watcher: $msg" );
my $obj;
@@ -104,7 +104,7 @@
my $txns = RT::Transactions->new( $RT::SystemUser );
$txns->LimitToTicket( $ticket->id );
my( $c_daily, $c_weekly, $c_susp ) = ( 0, 0, 0 );
-while( my $txn = $txns->Next ) {
+while( my $txn = $txns->next ) {
my @daily_rcpt = $txn->DeferredRecipients( 'daily' );
my @weekly_rcpt = $txn->DeferredRecipients('weekly' );
my @susp_rcpt = $txn->DeferredRecipients( 'susp' );
Modified: rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/action_linear_escalate.t Fri Aug 22 14:43:25 2008
@@ -14,12 +14,12 @@
use_ok('RT::Action::LinearEscalate');
-my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
+my $q = RT::Test->load_or_create_queue( name => 'Regression' );
ok $q && $q->id, 'loaded or created queue';
# rt-cron-tool uses Gecos name to get rt user, so we'd better create one
my $gecos = RT::Test->load_or_create_user(
- Name => 'gecos',
+ name => 'gecos',
Password => 'password',
Gecos => ($^O eq 'MSWin32') ? Win32::LoginName() : (getpwuid($<))[0],
);
@@ -30,7 +30,7 @@
my $user = RT::Test->load_or_create_user(
- Name => 'user', Password => 'password',
+ name => 'user', Password => 'password',
);
ok $user && $user->id, 'loaded or created user';
Modified: rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/add-watchers.t Fri Aug 22 14:43:25 2008
@@ -63,20 +63,20 @@
my $acl = RT::ACL->new($RT::SystemUser);
$acl->Limit( FIELD => 'RightName', OPERATOR => '!=', VALUE => 'SuperUser' );
$acl->LimitToObject( $RT::System );
-while( my $ace = $acl->Next ) {
+while( my $ace = $acl->next ) {
$ace->Delete;
}
# create new queue to be sure we do not mess with rights
my $queue = RT::Model::Queue->new(current_user => RT->system_user);
-my ($queue_id) = $queue->create( Name => 'watcher tests '.$$);
+my ($queue_id) = $queue->create( name => 'watcher tests '.$$);
ok( $queue_id, 'queue created for watcher tests' );
# new privileged user to check rights
my $user = RT::Model::User->new(current_user => RT->system_user );
-my ($user_id) = $user->create( Name => 'watcher'.$$,
+my ($user_id) = $user->create( name => 'watcher'.$$,
email => "watcher$$".'@localhost',
- Privileged => 1,
+ privileged => 1,
Password => 'qwe123',
);
my $cu= RT::CurrentUser->new($user);
@@ -101,20 +101,20 @@
ok( $ticket2->Subject, "ticket load by user" );
# user can add self to ticket only after getting Watch right
-($rv, $msg) = $ticket2->AddWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
+($rv, $msg) = $ticket2->AddWatcher( Type => 'Cc', principal_id => $user->principal_id );
ok( !$rv, "user can't add self as Cc" );
-($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', PrincipalId => $user->PrincipalId );
+($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', principal_id => $user->principal_id );
ok( !$rv, "user can't add self as Requestor" );
$principal->grant_right( Right => 'Watch' , Object => $queue );
ok( $user->HasRight( Right => 'Watch', Object => $queue ), "user can watch queue tickets" );
-($rv, $msg) = $ticket2->AddWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
-ok( $rv, "user can add self as Cc by PrincipalId" );
-($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', PrincipalId => $user->PrincipalId );
-ok( $rv, "user can add self as Requestor by PrincipalId" );
+($rv, $msg) = $ticket2->AddWatcher( Type => 'Cc', principal_id => $user->principal_id );
+ok( $rv, "user can add self as Cc by principal_id" );
+($rv, $msg) = $ticket2->AddWatcher( Type => 'Requestor', principal_id => $user->principal_id );
+ok( $rv, "user can add self as Requestor by principal_id" );
# remove user and try adding with Email address
-($rv, $msg) = $ticket->DeleteWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
-ok( $rv, "watcher removed by PrincipalId" );
+($rv, $msg) = $ticket->DeleteWatcher( Type => 'Cc', principal_id => $user->principal_id );
+ok( $rv, "watcher removed by principal_id" );
($rv, $msg) = $ticket->DeleteWatcher( Type => 'Requestor', Email => $user->email );
ok( $rv, "watcher removed by Email" );
@@ -132,20 +132,20 @@
ok( $rv, "user loaded queue" );
# user can add self to queue only after getting Watch right
-($rv, $msg) = $queue2->AddWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
+($rv, $msg) = $queue2->AddWatcher( Type => 'Cc', principal_id => $user->principal_id );
ok( !$rv, "user can't add self as Cc" );
-($rv, $msg) = $queue2->AddWatcher( Type => 'Requestor', PrincipalId => $user->PrincipalId );
+($rv, $msg) = $queue2->AddWatcher( Type => 'Requestor', principal_id => $user->principal_id );
ok( !$rv, "user can't add self as Requestor" );
$principal->grant_right( Right => 'Watch' , Object => $queue );
ok( $user->HasRight( Right => 'Watch', Object => $queue ), "user can watch queue queues" );
-($rv, $msg) = $queue2->AddWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
-ok( $rv, "user can add self as Cc by PrincipalId" );
-($rv, $msg) = $queue2->AddWatcher( Type => 'Requestor', PrincipalId => $user->PrincipalId );
-ok( $rv, "user can add self as Requestor by PrincipalId" );
+($rv, $msg) = $queue2->AddWatcher( Type => 'Cc', principal_id => $user->principal_id );
+ok( $rv, "user can add self as Cc by principal_id" );
+($rv, $msg) = $queue2->AddWatcher( Type => 'Requestor', principal_id => $user->principal_id );
+ok( $rv, "user can add self as Requestor by principal_id" );
# remove user and try adding with Email address
-($rv, $msg) = $queue->DeleteWatcher( Type => 'Cc', PrincipalId => $user->PrincipalId );
-ok( $rv, "watcher removed by PrincipalId" );
+($rv, $msg) = $queue->DeleteWatcher( Type => 'Cc', principal_id => $user->principal_id );
+ok( $rv, "watcher removed by principal_id" );
($rv, $msg) = $queue->DeleteWatcher( Type => 'Requestor', Email => $user->email );
ok( $rv, "watcher removed by Email" );
Modified: rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-multiple.t Fri Aug 22 14:43:25 2008
@@ -18,8 +18,8 @@
{
$queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
- Name => $queue_name,
- Description => 'queue for custom field sort testing'
+ name => $queue_name,
+ description => 'queue for custom field sort testing'
);
ok($ret, "$queue_name - test queue creation. $msg");
}
@@ -75,15 +75,15 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
- $tix->FromSQL( $query );
+ $tix->from_sql( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
- ok($tix->Count, "found ticket(s)")
+ ok($tix->count, "found ticket(s)")
or $error = 1;
my ($order_ok, $last) = (1, $order eq 'ASC'? '-': 'zzzzzz');
my $last_id = $tix->Last->id;
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
my $tmp;
next if $t->id == $last_id and $t->Subject eq "-"; # Nulls are allowed to come last, in Pg
@@ -104,7 +104,7 @@
if ( $error ) {
diag "Wrong SQL query:". $tix->BuildSelectQuery;
$tix->GotoFirstItem;
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
diag sprintf "%02d - %s", $t->id, $t->Subject;
}
}
Modified: rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/cfsort-freeform-single.t Fri Aug 22 14:43:25 2008
@@ -18,8 +18,8 @@
{
$queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
- Name => $queue_name,
- Description => 'queue for custom field sort testing'
+ name => $queue_name,
+ description => 'queue for custom field sort testing'
);
ok($ret, "$queue test queue creation. $msg");
}
@@ -84,15 +84,15 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
- $tix->FromSQL( $query );
+ $tix->from_sql( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
- ok($tix->Count, "found ticket(s)")
+ ok($tix->count, "found ticket(s)")
or $error = 1;
my ($order_ok, $last) = (1, $order eq 'ASC'? '-': 'zzzzzz');
my $last_id = $tix->Last->id;
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
my $tmp;
next if $t->id == $last_id and $t->Subject eq "-"; # Nulls are allowed to come last, in Pg
@@ -113,7 +113,7 @@
if ( $error ) {
diag "Wrong SQL query:". $tix->BuildSelectQuery;
$tix->GotoFirstItem;
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
diag sprintf "%02d - %s", $t->id, $t->Subject;
}
}
Modified: rt/branches/3.999-DANGEROUS/t/ticket/search_by_links.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/search_by_links.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/search_by_links.t Fri Aug 22 14:43:25 2008
@@ -7,7 +7,7 @@
use RT::Test;
use RT::Model::Ticket;
-my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
+my $q = RT::Test->load_or_create_queue( name => 'Regression' );
ok $q && $q->id, 'loaded or created queue';
my ($total, @data, @tickets, %test) = (0, ());
@@ -19,7 +19,7 @@
my %args = %{ shift(@data) };
$args{$_} = $res[ $args{$_} ]->id foreach grep $args{$_}, keys %RT::Model::Ticket::LINKTYPEMAP;
my ( $id, undef $msg ) = $t->create(
- Queue => $q->id,
+ queue => $q->id,
%args,
);
ok( $id, "ticket created" ) or diag("error: $msg");
@@ -33,18 +33,18 @@
my $query_prefix = join ' OR ', map 'id = '. $_->id, @tickets;
foreach my $key ( sort keys %test ) {
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
- $tix->FromSQL( "( $query_prefix ) AND ( $key )" );
+ $tix->from_sql( "( $query_prefix ) AND ( $key )" );
my $error = 0;
my $count = 0;
$count++ foreach grep $_, values %{ $test{$key} };
- is($tix->Count, $count, "found correct number of ticket(s) by '$key'") or $error = 1;
+ is($tix->count, $count, "found correct number of ticket(s) by '$key'") or $error = 1;
my $good_tickets = 1;
- while ( my $ticket = $tix->Next ) {
- next if $test{$key}->{ $ticket->Subject };
- diag $ticket->Subject ." ticket has been found when it's not expected";
+ while ( my $ticket = $tix->next ) {
+ next if $test{$key}->{ $ticket->subject };
+ diag $ticket->subject ." ticket has been found when it's not expected";
$good_tickets = 0;
}
ok( $good_tickets, "all tickets are good with '$key'" ) or $error = 1;
@@ -55,9 +55,9 @@
# simple set with "no links", "parent and child"
@data = (
- { Subject => '-', },
- { Subject => 'p', },
- { Subject => 'c', MemberOf => -1 },
+ { subject => '-', },
+ { subject => 'p', },
+ { subject => 'c', MemberOf => -1 },
);
@tickets = add_tix_from_data();
%test = (
@@ -68,8 +68,8 @@
'LinkedFrom IS NOT NULL' => { '-' => 0, c => 0, p => 1 },
'LinkedFrom IS NULL' => { '-' => 1, c => 1, p => 0 },
- 'HasMember IS NOT NULL' => { '-' => 0, c => 0, p => 1 },
- 'HasMember IS NULL' => { '-' => 1, c => 1, p => 0 },
+ 'has_member IS NOT NULL' => { '-' => 0, c => 0, p => 1 },
+ 'has_member IS NULL' => { '-' => 1, c => 1, p => 0 },
'MemberOf IS NOT NULL' => { '-' => 0, c => 1, p => 0 },
'MemberOf IS NULL' => { '-' => 1, c => 0, p => 1 },
@@ -84,19 +84,19 @@
);
{
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
- $tix->FromSQL("Queue = '". $q->id ."'");
- is($tix->Count, $total, "found $total tickets");
+ $tix->from_sql("Queue = '". $q->id ."'");
+ is($tix->count, $total, "found $total tickets");
}
run_tests();
# another set with tests of combinations searches
@data = (
- { Subject => '-', },
- { Subject => 'p', },
- { Subject => 'rp', RefersTo => -1 },
- { Subject => 'c', MemberOf => -2 },
- { Subject => 'rc1', RefersTo => -1 },
- { Subject => 'rc2', RefersTo => -2 },
+ { subject => '-', },
+ { subject => 'p', },
+ { subject => 'rp', RefersTo => -1 },
+ { subject => 'c', MemberOf => -2 },
+ { subject => 'rc1', RefersTo => -1 },
+ { subject => 'rc2', RefersTo => -2 },
);
@tickets = add_tix_from_data();
my $pid = $tickets[1]->id;
@@ -126,8 +126,8 @@
);
{
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
- $tix->FromSQL("Queue = '". $q->id ."'");
- is($tix->Count, $total, "found $total tickets");
+ $tix->from_sql("Queue = '". $q->id ."'");
+ is($tix->count, $total, "found $total tickets");
}
run_tests();
Modified: rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/search_long_cf_values.t Fri Aug 22 14:43:25 2008
@@ -54,27 +54,27 @@
# we have tickets. start searching
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
-$tix->FromSQL("Queue = '$queue' AND CF.SearchTest LIKE 'foo'");
-is($tix->Count, 1, "matched short string foo")
+$tix->from_sql("Queue = '$queue' AND CF.SearchTest LIKE 'foo'");
+is($tix->count, 1, "matched short string foo")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
$tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
-$tix->FromSQL("Queue = '$queue' AND CF.SearchTest LIKE 'bar'");
-is($tix->Count, 2, "matched long+short string bar")
+$tix->from_sql("Queue = '$queue' AND CF.SearchTest LIKE 'bar'");
+is($tix->count, 2, "matched long+short string bar")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
$tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
-$tix->FromSQL("Queue = '$queue' AND ( CF.SearchTest LIKE 'foo' OR CF.SearchTest LIKE 'bar' )");
-is($tix->Count, 3, "matched short string foo or long+short string bar")
+$tix->from_sql("Queue = '$queue' AND ( CF.SearchTest LIKE 'foo' OR CF.SearchTest LIKE 'bar' )");
+is($tix->count, 3, "matched short string foo or long+short string bar")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
$tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
-$tix->FromSQL("Queue = '$queue' AND CF.SearchTest NOT LIKE 'foo' AND CF.SearchTest LIKE 'bar'");
-is($tix->Count, 2, "not matched short string foo and matched long+short string bar")
+$tix->from_sql("Queue = '$queue' AND CF.SearchTest NOT LIKE 'foo' AND CF.SearchTest LIKE 'bar'");
+is($tix->count, 2, "not matched short string foo and matched long+short string bar")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
$tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
-$tix->FromSQL("Queue = '$queue' AND CF.SearchTest LIKE 'foo' AND CF.SearchTest NOT LIKE 'bar'");
-is($tix->Count, 1, "matched short string foo and not matched long+short string bar")
+$tix->from_sql("Queue = '$queue' AND CF.SearchTest LIKE 'foo' AND CF.SearchTest NOT LIKE 'bar'");
+is($tix->count, 1, "matched short string foo and not matched long+short string bar")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
Modified: rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/sort-by-queue.t Fri Aug 22 14:43:25 2008
@@ -22,8 +22,8 @@
foreach my $name ( qw(sort-by-queue-Z sort-by-queue-A) ) {
my $queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
- Name => $name ."-$$",
- Description => 'queue to test sorting by queue'
+ name => $name ."-$$",
+ description => 'queue to test sorting by queue'
);
ok($ret, "test queue creation. $msg");
push @queues, $queue;
@@ -55,14 +55,14 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
- $tix->FromSQL( $query );
+ $tix->from_sql( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
- ok($tix->Count, "found ticket(s)")
+ ok($tix->count, "found ticket(s)")
or $error = 1;
my ($order_ok, $last) = (1, $order eq 'ASC'? '-': 'zzzzzz');
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
my $tmp;
if ( $order eq 'ASC' ) {
$tmp = ((split( /,/, $last))[0] cmp (split( /,/, $t->Subject))[0]);
@@ -81,7 +81,7 @@
if ( $error ) {
diag "Wrong SQL query:". $tix->BuildSelectQuery;
$tix->GotoFirstItem;
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
diag sprintf "%02d - %s", $t->id, $t->Subject;
}
}
Modified: rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/sort-by-user.t Fri Aug 22 14:43:25 2008
@@ -21,8 +21,8 @@
{
$queue = RT::Model::Queue->new(current_user => RT->system_user );
my ($ret, $msg) = $queue->create(
- Name => $queue_name,
- Description => 'queue for custom field sort testing'
+ name => $queue_name,
+ description => 'queue for custom field sort testing'
);
ok($ret, "$queue test queue creation. $msg");
}
@@ -34,8 +34,8 @@
my $name = $u ."-user-to-test-ordering-$$";
my $user = RT::Model::User->new(current_user => RT->system_user );
my ($uid) = $user->create(
- Name => $name,
- Privileged => 1,
+ name => $name,
+ privileged => 1,
);
ok $uid, "created user #$uid";
@@ -84,14 +84,14 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
- $tix->FromSQL( $query );
+ $tix->from_sql( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
- ok($tix->Count, "found ticket(s)")
+ ok($tix->count, "found ticket(s)")
or $error = 1;
my ($order_ok, $last) = (1, $order eq 'ASC'? '-': 'zzzzzz');
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
my $tmp;
if ( $order eq 'ASC' ) {
$tmp = ((split( /,/, $last))[0] cmp (split( /,/, $t->Subject))[0]);
@@ -110,7 +110,7 @@
if ( $error ) {
diag "Wrong SQL query:". $tix->BuildSelectQuery;
$tix->GotoFirstItem;
- while ( my $t = $tix->Next ) {
+ while ( my $t = $tix->next ) {
diag sprintf "%02d - %s", $t->id, $t->Subject;
}
}
Modified: rt/branches/3.999-DANGEROUS/t/web/cf_access.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/cf_access.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/cf_access.t Fri Aug 22 14:43:25 2008
@@ -20,7 +20,7 @@
$m->submit_form(
form_name => "modify_custom_field",
fields => {
- type_composite => 'Image-0',
+ type_composite => 'Image-0',
lookup_type => 'RT::Model::Queue-RT::Model::Ticket',
name => 'img',
description => 'img',
Modified: rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/cf_onqueue.t Fri Aug 22 14:43:25 2008
@@ -17,10 +17,10 @@
$m->submit_form(
form_name => "modify_custom_field",
fields => {
- TypeComposite => 'Freeform-1',
+ type_composite => 'Freeform-1',
lookup_type => 'RT::Model::Queue',
- Name => 'QueueCFTest',
- Description => 'QueueCFTest',
+ name => 'QueueCFTest',
+ description => 'QueueCFTest',
},
);
$m->content_like( qr/Object created/, 'CF QueueCFTest created' );
Modified: rt/branches/3.999-DANGEROUS/t/web/cf_select_one.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/cf_select_one.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/cf_select_one.t Fri Aug 22 14:43:25 2008
@@ -23,7 +23,7 @@
form_name => "modify_custom_field",
fields => {
name => $cf_name,
- type_composite => 'Select-1',
+ type_composite => 'Select-1',
lookup_type => 'RT::Model::Queue-RT::Model::Ticket',
},
);
Modified: rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/dashboards-groups.t Fri Aug 22 14:43:25 2008
@@ -30,28 +30,28 @@
# }}}
# create and test groups (outer < inner < user) {{{
my $inner_group = RT::Model::Group->new(current_user => RT->system_user);
-($ok, $msg) = $inner_group->create_user_defined_group(Name => "inner", Description => "inner group");
+($ok, $msg) = $inner_group->create_user_defined_group(Name => "inner", description => "inner group");
ok($ok, "created inner group: $msg");
my $outer_group = RT::Model::Group->new(current_user => RT->system_user);
-($ok, $msg) = $outer_group->create_user_defined_group(Name => "outer", Description => "outer group");
+($ok, $msg) = $outer_group->create_user_defined_group(Name => "outer", description => "outer group");
ok($ok, "created outer group: $msg");
-($ok, $msg) = $outer_group->AddMember($inner_group->PrincipalId);
+($ok, $msg) = $outer_group->add_member($inner_group->principal_id);
ok($ok, "added inner as a member of outer: $msg");
-($ok, $msg) = $inner_group->AddMember($user_obj->PrincipalId);
+($ok, $msg) = $inner_group->add_member($user_obj->principal_id);
ok($ok, "added user as a member of member: $msg");
-ok($outer_group->HasMember($inner_group->PrincipalId), "outer has inner");
-ok(!$outer_group->HasMember($user_obj->PrincipalId), "outer doesn't have user directly");
-ok($outer_group->HasMemberRecursively($inner_group->PrincipalId), "outer has inner recursively");
-ok($outer_group->HasMemberRecursively($user_obj->PrincipalId), "outer has user recursively");
-
-ok(!$inner_group->HasMember($outer_group->PrincipalId), "inner doesn't have outer");
-ok($inner_group->HasMember($user_obj->PrincipalId), "inner has user");
-ok(!$inner_group->HasMemberRecursively($outer_group->PrincipalId), "inner doesn't have outer, even recursively");
-ok($inner_group->HasMemberRecursively($user_obj->PrincipalId), "inner has user recursively");
+ok($outer_group->has_member($inner_group->principal_id), "outer has inner");
+ok(!$outer_group->has_member($user_obj->principal_id), "outer doesn't have user directly");
+ok($outer_group->has_memberRecursively($inner_group->principal_id), "outer has inner recursively");
+ok($outer_group->has_memberRecursively($user_obj->principal_id), "outer has user recursively");
+
+ok(!$inner_group->has_member($outer_group->principal_id), "inner doesn't have outer");
+ok($inner_group->has_member($user_obj->principal_id), "inner has user");
+ok(!$inner_group->has_memberRecursively($outer_group->principal_id), "inner doesn't have outer, even recursively");
+ok($inner_group->has_memberRecursively($user_obj->principal_id), "inner has user recursively");
# }}}
ok $m->login(customer => 'customer'), "logged in";
More information about the Rt-commit
mailing list