[Rt-commit] r15376 - in rt/branches/3.999-DANGEROUS: . share/html/Admin/Tools/Shredder share/html/Admin/Tools/Shredder/Elements share/html/NoAuth/js share/html/Widgets/Form t/api t/mail t/maildigest t/web
jesse at bestpractical.com
jesse at bestpractical.com
Fri Aug 22 13:43:36 EDT 2008
Author: jesse
Date: Fri Aug 22 13:43:35 2008
New Revision: 15376
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox
rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/index.html
rt/branches/3.999-DANGEROUS/share/html/NoAuth/js/util.js
rt/branches/3.999-DANGEROUS/share/html/Widgets/Form/Select
rt/branches/3.999-DANGEROUS/t/api/reminders.t
rt/branches/3.999-DANGEROUS/t/mail/charsets-outgoing.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/badlinks.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/deferred_owner.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/dashboards-groups.t
rt/branches/3.999-DANGEROUS/t/web/dashboards.t
rt/branches/3.999-DANGEROUS/t/web/quicksearch.t
rt/branches/3.999-DANGEROUS/t/web/rest.t
rt/branches/3.999-DANGEROUS/t/web/unlimited_search.t
Log:
r43696 at 68-246-31-102: jesse | 2008-08-19 20:41:00 -0400
WipeoutObject -> wipeout_object
r43697 at 68-246-31-102: jesse | 2008-08-19 20:42:15 -0400
wipeout object fiex
r44028 at 68-246-31-102: jesse | 2008-08-22 13:43:08 -0400
* some initial work to fsck the newly updated tests from sunnavy
Modified: rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox Fri Aug 22 13:43:35 2008
@@ -48,7 +48,7 @@
<%ARGS>
$object => undef
</%ARGS>
-<input type="checkbox" name="wipeoutobject" value="<% $object->_as_string %>" />
+<input type="checkbox" name="wipeout_object" value="<% $object->_as_string %>" />
<span>
% if( $m->comp_exists( $path ) ) {
% $m->comp( $path, object => $object );
Modified: rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/index.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/index.html (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/index.html Fri Aug 22 13:43:35 2008
@@ -49,7 +49,7 @@
$plugin => ''
$search => ''
$wipeout => ''
- at wipeoutobject => ()
+ at wipeout_object => ()
</%ARGS>
<& /Admin/Elements/Header, title => $title &>
<& /Admin/Elements/ToolTabs,
@@ -149,7 +149,7 @@
$shredder->add_dump_plugin( object => $backup_plugin );
- $shredder->put_objects( objects => \@WipeoutObject );
+ $shredder->put_objects( objects => \@wipeout_object );
($status, $msg) = $plugin_obj->set_resolvers( Shredder => $shredder );
unless( $status ) {
push @{ $messages{Errors} }, $msg;
Modified: rt/branches/3.999-DANGEROUS/share/html/NoAuth/js/util.js
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/NoAuth/js/util.js (original)
+++ rt/branches/3.999-DANGEROUS/share/html/NoAuth/js/util.js Fri Aug 22 13:43:35 2008
@@ -278,7 +278,7 @@
var check = $('shredder-select-all-objects-checkbox').checked;
var elements = $('shredder-search-form').elements;
for( var i = 0; i < elements.length; i++ ) {
- if( elements[i].name != 'Wipeoutobject' ) {
+ if( elements[i].name != 'wipeout_object' ) {
continue;
}
if( elements[i].type != 'checkbox' ) {
Modified: rt/branches/3.999-DANGEROUS/share/html/Widgets/Form/Select
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Widgets/Form/Select (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Widgets/Form/Select Fri Aug 22 13:43:35 2008
@@ -71,7 +71,7 @@
$default => 1,
@default_value => (),
-$default_label => _('Use system default (%1)', join ', ', @default_value),
+$default_label => _('Use system default (%1)', join ', ', (@default_value||'')),
$alternative => 0,
$alternative_label => _('other...'),
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 13:43:35 2008
@@ -13,20 +13,20 @@
use_ok ('RT::Queue');
ok(my $testqueue = RT::Queue->new($RT::SystemUser), 'Instantiate RT::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
-use_ok('RT::Ticket');
+use_ok('RT::Model::Ticket');
-my $u = RT::User->new($RT::SystemUser);
+my $u = RT::Model::User->new(current_user => RT->system_user);
$u->Load("root");
ok ($u->Id, "Found the root user");
-ok(my $t = RT::Ticket->new($RT::SystemUser), 'Instantiate RT::Ticket');
-ok(my ($id, $msg) = $t->Create( Queue => $testqueue->Id,
+ok(my $t = RT::Model::Ticket->new(current_user => RT->system_user), 'Instantiate RT::Model::Ticket');
+ok(my ($id, $msg) = $t->create( Queue => $testqueue->Id,
Subject => 'Testing',
Owner => $u->Id
), 'Create sample ticket');
Modified: rt/branches/3.999-DANGEROUS/t/mail/charsets-outgoing.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/mail/charsets-outgoing.t (original)
+++ rt/branches/3.999-DANGEROUS/t/mail/charsets-outgoing.t Fri Aug 22 13:43:35 2008
@@ -41,8 +41,8 @@
diag "basic test of autoreply" if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => 'test',
Requestor => 'root at localhost',
@@ -58,8 +58,8 @@
diag "non-ascii Subject with ascii prefix set in the template"
if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => $str_ru_test,
Requestor => 'root at localhost',
@@ -85,8 +85,8 @@
diag "ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => 'test',
Requestor => 'root at localhost',
@@ -106,8 +106,8 @@
diag "non-ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => $str_ru_test,
Requestor => 'root at localhost',
@@ -150,8 +150,8 @@
diag "ascii subject with non-ascii subject prefix in template" if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => 'test',
Requestor => 'root at localhost',
@@ -172,8 +172,8 @@
diag "non-ascii subject with non-ascii subject prefix in template"
if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => $str_ru_test,
Requestor => 'root at localhost',
@@ -202,8 +202,8 @@
diag "non-ascii subject, non-ascii prefix in template and non-ascii tag"
if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => $str_ru_test,
Requestor => 'root at localhost',
@@ -249,8 +249,8 @@
diag "non-ascii Subject without changes in template" if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => $str_ru_test,
Requestor => 'root at localhost',
@@ -277,8 +277,8 @@
diag "non-ascii Subject without changes in template and with non-ascii subject tag"
if $ENV{'TEST_VERBOSE'};
{
- my $ticket = RT::Ticket->new( $RT::SystemUser );
- $ticket->Create(
+ my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+ $ticket->create(
Queue => $queue->id,
Subject => $str_ru_test,
Requestor => 'root at localhost',
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 13:43:35 2008
@@ -8,12 +8,12 @@
my @users = qw/ emailnormal at example.com emaildaily at example.com emailweekly at example.com emailsusp at example.com /;
my( $ret, $msg );
-my $user_n = RT::User->new( $RT::SystemUser );
+my $user_n = RT::Model::User->new(current_user => RT->system_user );
( $ret, $msg ) = $user_n->LoadOrCreateByEmail( $users[0] );
ok( $ret, "user with default email prefs created: $msg" );
$user_n->SetPrivileged( 1 );
-my $user_d = RT::User->new( $RT::SystemUser );
+my $user_d = RT::Model::User->new(current_user => RT->system_user );
( $ret, $msg ) = $user_d->LoadOrCreateByEmail( $users[1] );
ok( $ret, "user with daily digest email prefs created: $msg" );
# Set a username & password for testing the interface.
@@ -22,13 +22,13 @@
-my $user_w = RT::User->new( $RT::SystemUser );
+my $user_w = RT::Model::User->new(current_user => RT->system_user );
( $ret, $msg ) = $user_w->LoadOrCreateByEmail( $users[2] );
ok( $ret, "user with weekly digest email prefs created: $msg" );
$user_w->SetPrivileged( 1 );
$user_w->SetPreferences($RT::System => { %{ $user_w->Preferences( $RT::System ) || {}}, EmailFrequency => 'Weekly digest'});
-my $user_s = RT::User->new( $RT::SystemUser );
+my $user_s = RT::Model::User->new(current_user => RT->system_user );
( $ret, $msg ) = $user_s->LoadOrCreateByEmail( $users[3] );
ok( $ret, "user with suspended email prefs created: $msg" );
$user_s->SetPreferences($RT::System => { %{ $user_s->Preferences( $RT::System ) || {}}, EmailFrequency => 'Suspended'});
@@ -40,7 +40,7 @@
# Make a testing queue for ourselves.
my $testq = RT::Queue->new( $RT::SystemUser );
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' );
@@ -77,8 +77,8 @@
# Create a ticket with To: Cc: Bcc: fields using our four users.
my $id;
-my $ticket = RT::Ticket->new( $RT::SystemUser );
-( $id, $ret, $msg ) = $ticket->Create( Queue => $testq->Name,
+my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+( $id, $ret, $msg ) = $ticket->create( Queue => $testq->Name,
Requestor => [ $user_w->Name ],
Subject => 'Test ticket for RT::Extension::EmailDigest',
);
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 13:43:35 2008
@@ -72,8 +72,8 @@
my $due = RT::Date->new($RT::SystemUser);
$due->Unix(time() + ( 7 * 24 * 60**2 ));
- my $ticket = RT::Ticket->new($user);
- ($id, $msg) = $ticket->Create( Queue => $q->id,
+ my $ticket = RT::Model::Ticket->new($user);
+ ($id, $msg) = $ticket->create( Queue => $q->id,
Subject => "Escalation test",
Priority => 0,
InitialPriority => 0,
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 13:43:35 2008
@@ -53,9 +53,9 @@
no warnings 'once';
use RT::Queue;
-use RT::User;
+use RT::Model::User;
use RT::Group;
-use RT::Ticket;
+use RT::Model::Ticket;
use RT::CurrentUser;
@@ -69,12 +69,12 @@
# create new queue to be sure we do not mess with rights
my $queue = RT::Queue->new($RT::SystemUser);
-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::User->new( $RT::SystemUser );
-my ($user_id) = $user->Create( Name => 'watcher'.$$,
+my $user = RT::Model::User->new(current_user => RT->system_user );
+my ($user_id) = $user->create( Name => 'watcher'.$$,
EmailAddress => "watcher$$".'@localhost',
Privileged => 1,
Password => 'qwe123',
@@ -92,11 +92,11 @@
ok( !$user->HasRight( Right => 'ModifyTicket', Object => $queue ), "user can't modify queue tickets" );
ok( !$user->HasRight( Right => 'Watch', Object => $queue ), "user can't watch queue tickets" );
-my $ticket = RT::Ticket->new( $RT::SystemUser );
-my ($rv, $msg) = $ticket->Create( Subject => 'watcher tests', Queue => $queue->Name );
+my $ticket = RT::Model::Ticket->new(current_user => RT->system_user );
+my ($rv, $msg) = $ticket->create( Subject => 'watcher tests', Queue => $queue->Name );
ok( $ticket->id, "ticket created" );
-my $ticket2 = RT::Ticket->new( $cu );
+my $ticket2 = RT::Model::Ticket->new(current_user => $cu );
$ticket2->Load( $ticket->id );
ok( $ticket2->Subject, "ticket load by user" );
Modified: rt/branches/3.999-DANGEROUS/t/ticket/badlinks.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/badlinks.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/badlinks.t Fri Aug 22 13:43:35 2008
@@ -10,8 +10,8 @@
my $queue = RT::Test->load_or_create_queue(Name => 'General');
ok($queue->Id, "loaded the General queue");
-my $ticket = RT::Ticket->new($RT::SystemUser);
-my ($tid, $txn, $msg) = $ticket->Create(
+my $ticket = RT::Model::Ticket->new(current_user => RT->system_user);
+my ($tid, $txn, $msg) = $ticket->create(
Queue => $queue->id,
Subject => 'test links',
);
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 13:43:35 2008
@@ -6,7 +6,7 @@
use strict;
use warnings;
-use RT::Tickets;
+use RT::Model::TicketCollection;
use RT::Queue;
use RT::CustomField;
@@ -17,7 +17,7 @@
my $queue;
{
$queue = RT::Queue->new( $RT::SystemUser );
- my ($ret, $msg) = $queue->Create(
+ my ($ret, $msg) = $queue->create(
Name => $queue_name,
Description => 'queue for custom field sort testing'
);
@@ -29,7 +29,7 @@
my $cf;
{
$cf = RT::CustomField->new( $RT::SystemUser );
- my ($ret, $msg) = $cf->Create(
+ my ($ret, $msg) = $cf->create(
Name => $cf_name,
Queue => $queue->id,
Type => 'FreeformMultiple',
@@ -43,7 +43,7 @@
my @res = ();
@data = sort { rand(100) <=> rand(100) } @data;
while (@data) {
- my $t = RT::Ticket->new($RT::SystemUser);
+ my $t = RT::Model::Ticket->new(current_user => RT->system_user);
my %args = %{ shift(@data) };
my @values = ();
if ( exists $args{'CF'} && ref $args{'CF'} ) {
@@ -54,7 +54,7 @@
$args{ 'CustomField-'. $cf->id } = \@values
if @values;
my $subject = join(",", sort @values) || '-';
- my ( $id, undef $msg ) = $t->Create(
+ my ( $id, undef $msg ) = $t->create(
%args,
Queue => $queue->id,
Subject => $subject,
@@ -74,7 +74,7 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
- my $tix = RT::Tickets->new( $RT::SystemUser );
+ my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
$tix->FromSQL( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
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 13:43:35 2008
@@ -6,7 +6,7 @@
use strict;
use warnings;
-use RT::Tickets;
+use RT::Model::TicketCollection;
use RT::Queue;
use RT::CustomField;
@@ -17,7 +17,7 @@
my $queue;
{
$queue = RT::Queue->new( $RT::SystemUser );
- my ($ret, $msg) = $queue->Create(
+ my ($ret, $msg) = $queue->create(
Name => $queue_name,
Description => 'queue for custom field sort testing'
);
@@ -32,7 +32,7 @@
{
$cf_name = $CF{'CF'}{'name'} = "Order$$";
$CF{'CF'}{'obj'} = RT::CustomField->new( $RT::SystemUser );
- my ($ret, $msg) = $CF{'CF'}{'obj'}->Create(
+ my ($ret, $msg) = $CF{'CF'}{'obj'}->create(
Name => $CF{'CF'}{'name'},
Queue => $queue->id,
Type => 'FreeformSingle',
@@ -46,7 +46,7 @@
my @res = ();
@data = sort { rand(100) <=> rand(100) } @data;
while (@data) {
- my $t = RT::Ticket->new($RT::SystemUser);
+ my $t = RT::Model::Ticket->new(current_user => RT->system_user);
my %args = %{ shift(@data) };
my $subject = '-';
@@ -63,7 +63,7 @@
if $e eq 'CF';
}
- my ( $id, undef $msg ) = $t->Create(
+ my ( $id, undef $msg ) = $t->create(
%args,
Queue => $queue->id,
Subject => $subject,
@@ -83,7 +83,7 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
- my $tix = RT::Tickets->new( $RT::SystemUser );
+ my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
$tix->FromSQL( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
@@ -164,7 +164,7 @@
{
$CF{'AnotherCF'}{'name'} = "OrderAnother$$";
$CF{'AnotherCF'}{'obj'} = RT::CustomField->new( $RT::SystemUser );
- my ($ret, $msg) = $CF{'AnotherCF'}{'obj'}->Create(
+ my ($ret, $msg) = $CF{'AnotherCF'}{'obj'}->create(
Name => $CF{'AnotherCF'}{'name'},
Queue => $queue->id,
Type => 'FreeformSingle',
Modified: rt/branches/3.999-DANGEROUS/t/ticket/deferred_owner.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/ticket/deferred_owner.t (original)
+++ rt/branches/3.999-DANGEROUS/t/ticket/deferred_owner.t Fri Aug 22 13:43:35 2008
@@ -4,7 +4,7 @@
use warnings;
use_ok('RT');
-use_ok('RT::Ticket');
+use_ok('RT::Model::Ticket');
use RT::Test;
@@ -31,10 +31,10 @@
Right => [qw(ModifyTicket)],
},
);
- my $ticket = RT::Ticket->new( $tester );
+ my $ticket = RT::Model::Ticket->new(current_user => $tester );
# tester is owner, owner has right to modify owned tickets,
# this right is required to set somebody as AdminCc
- my ($tid, $txn_id, $msg) = $ticket->Create(
+ my ($tid, $txn_id, $msg) = $ticket->create(
Queue => $queue->id,
Owner => $tester->id,
AdminCc => 'root at localhost',
@@ -53,10 +53,10 @@
Right => [qw(SeeQueue ShowTicket CreateTicket OwnTicket)],
},
);
- my $ticket = RT::Ticket->new( $tester );
+ my $ticket = RT::Model::Ticket->new(current_user => $tester );
# tester is owner, owner has right to modify owned tickets,
# this right is required to set somebody as AdminCc
- my ($tid, $txn_id, $msg) = $ticket->Create(
+ my ($tid, $txn_id, $msg) = $ticket->create(
Queue => $queue->id,
Owner => $tester->id,
AdminCc => 'root at localhost',
@@ -78,9 +78,9 @@
Right => [qw(OwnTicket TakeTicket)],
},
);
- my $ticket = RT::Ticket->new( $tester );
+ my $ticket = RT::Model::Ticket->new(current_user => $tester );
# set tester as Cc, Cc role group has right to own and take tickets
- my ($tid, $txn_id, $msg) = $ticket->Create(
+ my ($tid, $txn_id, $msg) = $ticket->create(
Queue => $queue->id,
Owner => $tester->id,
Cc => 'tester at localhost',
@@ -98,9 +98,9 @@
Right => [qw(SeeQueue ShowTicket CreateTicket)],
},
);
- my $ticket = RT::Ticket->new( $tester );
+ my $ticket = RT::Model::Ticket->new(current_user => $tester );
# set tester as Cc, Cc role group has right to own and take tickets
- my ($tid, $txn_id, $msg) = $ticket->Create(
+ my ($tid, $txn_id, $msg) = $ticket->create(
Queue => $queue->id,
Owner => $tester->id,
Cc => 'tester at localhost',
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 13:43:35 2008
@@ -5,7 +5,7 @@
use Test::More tests => 80;
use RT::Test;
-use RT::Ticket;
+use RT::Model::Ticket;
my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
ok $q && $q->id, 'loaded or created queue';
@@ -15,10 +15,10 @@
sub add_tix_from_data {
my @res = ();
while (@data) {
- my $t = RT::Ticket->new($RT::SystemUser);
+ my $t = RT::Model::Ticket->new(current_user => RT->system_user);
my %args = %{ shift(@data) };
- $args{$_} = $res[ $args{$_} ]->id foreach grep $args{$_}, keys %RT::Ticket::LINKTYPEMAP;
- my ( $id, undef $msg ) = $t->Create(
+ $args{$_} = $res[ $args{$_} ]->id foreach grep $args{$_}, keys %RT::Model::Ticket::LINKTYPEMAP;
+ my ( $id, undef $msg ) = $t->create(
Queue => $q->id,
%args,
);
@@ -32,7 +32,7 @@
sub run_tests {
my $query_prefix = join ' OR ', map 'id = '. $_->id, @tickets;
foreach my $key ( sort keys %test ) {
- my $tix = RT::Tickets->new($RT::SystemUser);
+ my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
$tix->FromSQL( "( $query_prefix ) AND ( $key )" );
my $error = 0;
@@ -83,7 +83,7 @@
'MemberOf != '. $tickets[1]->id => { '-' => 1, c => 0, p => 1 },
);
{
- my $tix = RT::Tickets->new($RT::SystemUser);
+ my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
$tix->FromSQL("Queue = '". $q->id ."'");
is($tix->Count, $total, "found $total tickets");
}
@@ -125,7 +125,7 @@
"RefersTo != $pid OR MemberOf != $pid" => { '-' => 1, c => 1, p => 1, rp => 1, rc1 => 1, rc2 => 1 },
);
{
- my $tix = RT::Tickets->new($RT::SystemUser);
+ my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user);
$tix->FromSQL("Queue = '". $q->id ."'");
is($tix->Count, $total, "found $total tickets");
}
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 13:43:35 2008
@@ -13,19 +13,19 @@
my $q = RT::Queue->new($RT::SystemUser);
my $queue = 'SearchTests-'.$$;
-$q->Create(Name => $queue);
+$q->create(Name => $queue);
ok ($q->id, "Created the queue");
# setup the CF
my $cf = RT::CustomField->new($RT::SystemUser);
-$cf->Create(Name => 'SearchTest', Type => 'Freeform', MaxValues => 0, Queue => $q->id);
+$cf->create(Name => 'SearchTest', Type => 'Freeform', MaxValues => 0, Queue => $q->id);
ok($cf->id, "Created the SearchTest CF");
my $cflabel = "CustomField-".$cf->id;
# setup some tickets
-my $t1 = RT::Ticket->new($RT::SystemUser);
-my ( $id, undef $msg ) = $t1->Create(
+my $t1 = RT::Model::Ticket->new(current_user => RT->system_user);
+my ( $id, undef $msg ) = $t1->create(
Queue => $q->id,
Subject => 'SearchTest1',
Requestor => ['search at example.com'],
@@ -34,8 +34,8 @@
ok( $id, $msg );
-my $t2 = RT::Ticket->new($RT::SystemUser);
-( $id, undef, $msg ) = $t2->Create(
+my $t2 = RT::Model::Ticket->new(current_user => RT->system_user);
+( $id, undef, $msg ) = $t2->create(
Queue => $q->id,
Subject => 'SearchTest2',
Requestor => ['searchlong at example.com'],
@@ -43,8 +43,8 @@
);
ok( $id, $msg );
-my $t3 = RT::Ticket->new($RT::SystemUser);
-( $id, undef, $msg ) = $t3->Create(
+my $t3 = RT::Model::Ticket->new(current_user => RT->system_user);
+( $id, undef, $msg ) = $t3->create(
Queue => $q->id,
Subject => 'SearchTest3',
Requestor => ['searchlong at example.com'],
@@ -53,27 +53,27 @@
ok( $id, $msg );
# we have tickets. start searching
-my $tix = RT::Tickets->new($RT::SystemUser);
+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")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
-$tix = RT::Tickets->new($RT::SystemUser);
+$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")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
-$tix = RT::Tickets->new($RT::SystemUser);
+$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")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
-$tix = RT::Tickets->new($RT::SystemUser);
+$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")
or diag "wrong results from SQL:\n". $tix->BuildSelectCountQuery;
-$tix = RT::Tickets->new($RT::SystemUser);
+$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")
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 13:43:35 2008
@@ -6,7 +6,7 @@
use strict;
use warnings;
-use RT::Tickets;
+use RT::Model::TicketCollection;
use RT::Queue;
use RT::CustomField;
@@ -21,7 +21,7 @@
# create them in reverse order to avoid false positives
foreach my $name ( qw(sort-by-queue-Z sort-by-queue-A) ) {
my $queue = RT::Queue->new( $RT::SystemUser );
- my ($ret, $msg) = $queue->Create(
+ my ($ret, $msg) = $queue->create(
Name => $name ."-$$",
Description => 'queue to test sorting by queue'
);
@@ -36,9 +36,9 @@
my @res = ();
@data = sort { rand(100) <=> rand(100) } @data;
while (@data) {
- my $t = RT::Ticket->new($RT::SystemUser);
+ my $t = RT::Model::Ticket->new(current_user => RT->system_user);
my %args = %{ shift(@data) };
- my ( $id, undef, $msg ) = $t->Create( %args );
+ my ( $id, undef, $msg ) = $t->create( %args );
ok( $id, "ticket created" ) or diag("error: $msg");
push @res, $t;
$total++;
@@ -54,7 +54,7 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
- my $tix = RT::Tickets->new( $RT::SystemUser );
+ my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
$tix->FromSQL( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
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 13:43:35 2008
@@ -6,7 +6,7 @@
use strict;
use warnings;
-use RT::Tickets;
+use RT::Model::TicketCollection;
use RT::Queue;
use RT::CustomField;
@@ -20,7 +20,7 @@
my $queue;
{
$queue = RT::Queue->new( $RT::SystemUser );
- my ($ret, $msg) = $queue->Create(
+ my ($ret, $msg) = $queue->create(
Name => $queue_name,
Description => 'queue for custom field sort testing'
);
@@ -32,8 +32,8 @@
# create them in reverse order to avoid false positives
foreach my $u (qw(Z A)) {
my $name = $u ."-user-to-test-ordering-$$";
- my $user = RT::User->new( $RT::SystemUser );
- my ($uid) = $user->Create(
+ my $user = RT::Model::User->new(current_user => RT->system_user );
+ my ($uid) = $user->create(
Name => $name,
Privileged => 1,
);
@@ -54,10 +54,10 @@
my @res = ();
@data = sort { rand(100) <=> rand(100) } @data;
while (@data) {
- my $t = RT::Ticket->new($RT::SystemUser);
+ my $t = RT::Model::Ticket->new(current_user => RT->system_user);
my %args = %{ shift(@data) };
- my ( $id, undef, $msg ) = $t->Create( %args, Queue => $queue->id );
+ my ( $id, undef, $msg ) = $t->create( %args, Queue => $queue->id );
if ( $args{'Owner'} ) {
is $t->Owner, $args{'Owner'}, "owner is correct";
}
@@ -83,7 +83,7 @@
foreach my $order (qw(ASC DESC)) {
my $error = 0;
- my $tix = RT::Tickets->new( $RT::SystemUser );
+ my $tix = RT::Model::TicketCollection->new(current_user => RT->system_user );
$tix->FromSQL( $query );
$tix->OrderBy( FIELD => $test->{'Order'}, ORDER => $order );
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 13:43:35 2008
@@ -8,7 +8,7 @@
my $url = $m->rt_base_url;
# create user and queue {{{
-my $user_obj = RT::User->new($RT::SystemUser);
+my $user_obj = RT::Model::User->new(current_user => RT->system_user);
my ($ok, $msg) = $user_obj->LoadOrCreateByEmail('customer at example.com');
ok($ok, 'ACL test user creation');
$user_obj->SetName('customer');
@@ -18,7 +18,7 @@
my $currentuser = RT::CurrentUser->new($user_obj);
my $queue = RT::Queue->new($RT::SystemUser);
-$queue->Create(Name => 'SearchQueue'.$$);
+$queue->create(Name => 'SearchQueue'.$$);
$user_obj->PrincipalObj->GrantRight(Right => $_, Object => $queue)
for qw/SeeQueue ShowTicket OwnTicket/;
@@ -30,11 +30,11 @@
# }}}
# create and test groups (outer < inner < user) {{{
my $inner_group = RT::Group->new($RT::SystemUser);
-($ok, $msg) = $inner_group->CreateUserDefinedGroup(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::Group->new($RT::SystemUser);
-($ok, $msg) = $outer_group->CreateUserDefinedGroup(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);
@@ -60,14 +60,14 @@
$m->follow_link_ok({text => "New dashboard"});
$m->form_name('ModifyDashboard');
-is_deeply([$m->current_form->find_input('Privacy')->possible_values], ["RT::User-" . $user_obj->Id], "the only selectable privacy is user");
+is_deeply([$m->current_form->find_input('Privacy')->possible_values], ["RT::Model::User-" . $user_obj->Id], "the only selectable privacy is user");
$m->content_lacks('Delete', "Delete button hidden because we are creating");
$user_obj->PrincipalObj->GrantRight(Right => 'CreateGroupDashboard', Object => $inner_group);
$m->follow_link_ok({text => "New dashboard"});
$m->form_name('ModifyDashboard');
-is_deeply([$m->current_form->find_input('Privacy')->possible_values], ["RT::User-" . $user_obj->Id, "RT::Group-" . $inner_group->Id], "the only selectable privacies are user and inner group (not outer group)");
+is_deeply([$m->current_form->find_input('Privacy')->possible_values], ["RT::Model::User-" . $user_obj->Id, "RT::Group-" . $inner_group->Id], "the only selectable privacies are user and inner group (not outer group)");
$m->field("Name" => 'inner dashboard');
$m->field("Privacy" => "RT::Group-" . $inner_group->Id);
$m->content_lacks('Delete', "Delete button hidden because we are creating");
Modified: rt/branches/3.999-DANGEROUS/t/web/dashboards.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/dashboards.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/dashboards.t Fri Aug 22 13:43:35 2008
@@ -7,7 +7,7 @@
my $url = $m->rt_base_url;
-my $user_obj = RT::User->new($RT::SystemUser);
+my $user_obj = RT::Model::User->new(current_user => RT->system_user);
my ($ret, $msg) = $user_obj->LoadOrCreateByEmail('customer at example.com');
ok($ret, 'ACL test user creation');
$user_obj->SetName('customer');
@@ -17,7 +17,7 @@
my $currentuser = RT::CurrentUser->new($user_obj);
my $queue = RT::Queue->new($RT::SystemUser);
-$queue->Create(Name => 'SearchQueue'.$$);
+$queue->create(Name => 'SearchQueue'.$$);
$user_obj->PrincipalObj->GrantRight(Right => 'SeeQueue', Object => $queue);
$user_obj->PrincipalObj->GrantRight(Right => 'ShowTicket', Object => $queue);
$user_obj->PrincipalObj->GrantRight(Right => 'OwnTicket', Object => $queue);
@@ -87,7 +87,7 @@
$dashboard->LoadById($id);
is($dashboard->Name, "different dashboard");
-is($dashboard->Privacy, 'RT::User-' . $user_obj->Id, "correct privacy");
+is($dashboard->Privacy, 'RT::Model::User-' . $user_obj->Id, "correct privacy");
is($dashboard->PossibleHiddenSearches, 0, "all searches are visible");
my @searches = $dashboard->Searches;
@@ -108,8 +108,8 @@
like($searches[0]->Name, qr/newest unowned tickets/, "correct existing search name");
like($searches[1]->Name, qr/highest priority tickets I own/, "correct new search name");
-my $ticket = RT::Ticket->new($RT::SystemUser);
-$ticket->Create(
+my $ticket = RT::Model::Ticket->new(current_user => RT->system_user);
+$ticket->create(
Queue => $queue->Id,
Requestor => [ $user_obj->Name ],
Owner => $user_obj,
Modified: rt/branches/3.999-DANGEROUS/t/web/quicksearch.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/quicksearch.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/quicksearch.t Fri Aug 22 13:43:35 2008
@@ -8,13 +8,13 @@
my $url = $m->rt_base_url;
# merged tickets still show up in search
-my $t1 = RT::Ticket->new($RT::SystemUser);
-$t1->Create(
- Subject => 'base ticket'.$$,
- Queue => 'general',
- Owner => 'root',
- Requestor => 'customsearch at localhost',
- MIMEObj => MIME::Entity->build(
+my $t1 = RT::Model::Ticket->new(current_user => RT->system_user);
+$t1->create(
+ subject => 'base ticket'.$$,
+ queue => 'general',
+ owner => 'root',
+ requestor => 'customsearch at localhost',
+ mime_obj => MIME::Entity->build(
From => 'customsearch at localhost',
To => 'rt at localhost',
Subject => 'base ticket'.$$,
@@ -23,13 +23,13 @@
);
ok(my $id1 = $t1->id, 'created ticket for custom search');
-my $t2 = RT::Ticket->new($RT::SystemUser);
-$t2->Create(
- Subject => 'merged away'.$$,
- Queue => 'general',
- Owner => 'root',
- Requestor => 'customsearch at localhost',
- MIMEObj => MIME::Entity->build(
+my $t2 = RT::Model::Ticket->new(current_user => RT->system_user);
+$t2->create(
+ subject => 'merged away'.$$,
+ queue => 'general',
+ owner => 'root',
+ requestor => 'customsearch at localhost',
+ mime_obj => MIME::Entity->build(
From => 'customsearch at localhost',
To => 'rt at localhost',
Subject => 'merged away'.$$,
@@ -38,7 +38,7 @@
);
ok(my $id2 = $t2->id, 'created ticket for custom search');
-my ($ok, $msg) = $t2->MergeInto($id1);
+my ($ok, $msg) = $t2->merge_into($id1);
ok($ok, "merge: $msg");
ok($m->login, 'logged in');
Modified: rt/branches/3.999-DANGEROUS/t/web/rest.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/rest.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/rest.t Fri Aug 22 13:43:35 2008
@@ -8,16 +8,16 @@
for my $name ("severity", "fu()n:k/") {
my $cf = RT::Test->load_or_create_custom_field(
- Name => $name,
- Type => 'Freeform',
- Queue => 'General',
+ name => $name,
+ type => 'Freeform',
+ queue => 'General',
);
- ok($cf->Id, "created a CustomField");
- is($cf->Name, $name, "correct CF name");
+ ok($cf->id, "created a CustomField");
+ is($cf->name, $name, "correct CF name");
}
-my $queue = RT::Test->load_or_create_queue(Name => 'General');
-ok($queue->Id, "loaded the General queue");
+my $queue = RT::Test->load_or_create_queue(name => 'General');
+ok($queue->id, "loaded the General queue");
$m->post("$baseurl/REST/1.0/ticket/new", [
user => 'root',
@@ -42,16 +42,16 @@
pass => 'password',
content => $text,
-], Content_Type => 'form-data');
+], content_type => 'form-data');
my ($id) = $m->content =~ /Ticket (\d+) created/;
ok($id, "got ticket #$id");
-my $ticket = RT::Ticket->new($RT::SystemUser);
-$ticket->Load($id);
-is($ticket->Id, $id, "loaded the REST-created ticket");
-is($ticket->Subject, "REST interface", "subject successfully set");
-is($ticket->FirstCustomFieldValue("fu()n:k/"), "maximum", "CF successfully set");
+my $ticket = RT::Model::Ticket->new(current_user => RT->system_user);
+$ticket->load($id);
+is($ticket->id, $id, "loaded the REST-created ticket");
+is($ticket->subject, "REST interface", "subject successfully set");
+is($ticket->first_custom_field_value("fu()n:k/"), "maximum", "CF successfully set");
$m->post("$baseurl/REST/1.0/search/ticket", [
user => 'root',
Modified: rt/branches/3.999-DANGEROUS/t/web/unlimited_search.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/unlimited_search.t (original)
+++ rt/branches/3.999-DANGEROUS/t/web/unlimited_search.t Fri Aug 22 13:43:35 2008
@@ -6,9 +6,9 @@
use RT::Test;
RT::Test->started_ok;
-my $ticket = RT::Ticket->new($RT::SystemUser);
+my $ticket = RT::Model::Ticket->new(current_user => RT->system_user);
for ( 1 .. 75 ) {
- $ticket->Create(
+ $ticket->create(
Subject => 'Ticket ' . $_,
Queue => 'General',
Owner => 'root',
@@ -20,22 +20,22 @@
ok $agent->login('root', 'password'), 'logged in as root';
$agent->get_ok('/Search/Build.html');
-$agent->form_name('BuildQuery');
+$agent->form_name('build_query');
$agent->field('idOp', '>');
$agent->field('ValueOfid', '0');
$agent->submit('AddClause');
-$agent->form_name('BuildQuery');
+$agent->form_name('build_query');
$agent->field('RowsPerPage', '0');
$agent->submit('DoSearch');
$agent->follow_link_ok({text=>'Show Results'});
$agent->content_like(qr/Ticket 75/);
$agent->follow_link_ok({text=>'New Search'});
-$agent->form_name('BuildQuery');
+$agent->form_name('build_query');
$agent->field('idOp', '>');
$agent->field('ValueOfid', '0');
$agent->submit('AddClause');
-$agent->form_name('BuildQuery');
+$agent->form_name('build_query');
$agent->field('RowsPerPage', '50');
$agent->submit('DoSearch');
$agent->follow_link_ok({text=>'Bulk Update'});
More information about the Rt-commit
mailing list