first pass RT4 merge, RT#13852
[freeside.git] / rt / t / mail / charsets-outgoing.t
index e3f13fb..e17dd98 100644 (file)
@@ -18,8 +18,6 @@ my %string = (
     },
 );
 
-RT::Test->set_mail_catcher;
-
 my $queue = RT::Test->load_or_create_queue(
     Name              => 'Regression',
     CorrespondAddress => 'rt-recipient@example.com',
@@ -27,15 +25,15 @@ my $queue = RT::Test->load_or_create_queue(
 );
 ok $queue && $queue->id, 'loaded or created queue';
 
-diag "make sure queue has no subject tag" if $ENV{'TEST_VERBOSE'};
+diag "make sure queue has no subject tag";
 {
     my ($status, $msg) = $queue->SetSubjectTag( undef );
     ok $status, "set subject tag for the queue" or diag "error: $msg";
 }
 
-diag "set intial simple autoreply template" if $ENV{'TEST_VERBOSE'};
+diag "set intial simple autoreply template";
 {
-    my $template = RT::Template->new( $RT::SystemUser );
+    my $template = RT::Template->new( RT->SystemUser );
     $template->Load('Autoreply');
     ok $template->id, "loaded autoreply tempalte";
 
@@ -49,9 +47,9 @@ diag "set intial simple autoreply template" if $ENV{'TEST_VERBOSE'};
         or diag "error: $msg";
 }
 
-diag "basic test of autoreply" if $ENV{'TEST_VERBOSE'};
+diag "basic test of autoreply";
 {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => 'test',
@@ -61,10 +59,9 @@ diag "basic test of autoreply" if $ENV{'TEST_VERBOSE'};
     ok @mails, "got some outgoing emails";
 }
 
-diag "non-ascii Subject with ascii prefix set in the template"
-    if $ENV{'TEST_VERBOSE'};
+diag "non-ascii Subject with ascii prefix set in the template";
 foreach my $set ( 'ru', 'latin1' ) {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => $string{$set}{test},
@@ -85,15 +82,15 @@ foreach my $set ( 'ru', 'latin1' ) {
 
 foreach my $tag_set ( 'ru', 'latin1' ) {
 
-diag "set non-ascii subject tag for the queue" if $ENV{'TEST_VERBOSE'};
+diag "set non-ascii subject tag for the queue";
 {
     my ($status, $msg) = $queue->SetSubjectTag( $string{$tag_set}{support} );
     ok $status, "set subject tag for the queue" or diag "error: $msg";
 }
 
-diag "ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'};
+diag "ascii subject with non-ascii subject tag";
 {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => 'test',
@@ -112,9 +109,9 @@ diag "ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'};
     ok $status, "all mails have correct data";
 }
 
-diag "non-ascii subject with non-ascii subject tag" if $ENV{'TEST_VERBOSE'};
+diag "non-ascii subject with non-ascii subject tag";
 foreach my $set ( 'ru', 'latin1' ) {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => $string{$set}{test},
@@ -137,7 +134,7 @@ foreach my $set ( 'ru', 'latin1' ) {
 
 } # subject tag
 
-diag "return back the empty subject tag" if $ENV{'TEST_VERBOSE'};
+diag "return back the empty subject tag";
 {
     my ($status, $msg) = $queue->SetSubjectTag( undef );
     ok $status, "set subject tag for the queue" or diag "error: $msg";
@@ -146,9 +143,9 @@ diag "return back the empty subject tag" if $ENV{'TEST_VERBOSE'};
 
 foreach my $prefix_set ( 'ru', 'latin1' ) {
 
-diag "add non-ascii subject prefix in the autoreply template" if $ENV{'TEST_VERBOSE'};
+diag "add non-ascii subject prefix in the autoreply template";
 {
-    my $template = RT::Template->new( $RT::SystemUser );
+    my $template = RT::Template->new( RT->SystemUser );
     $template->Load('Autoreply');
     ok $template->id, "loaded autoreply tempalte";
 
@@ -161,9 +158,9 @@ diag "add non-ascii subject prefix in the autoreply template" if $ENV{'TEST_VERB
     ok $status, "changed content of the template" or diag "error: $msg";
 }
 
-diag "ascii subject with non-ascii subject prefix in template" if $ENV{'TEST_VERBOSE'};
+diag "ascii subject with non-ascii subject prefix in template";
 {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => 'test',
@@ -182,10 +179,9 @@ diag "ascii subject with non-ascii subject prefix in template" if $ENV{'TEST_VER
     ok $status, "all mails have correct data";
 }
 
-diag "non-ascii subject with non-ascii subject prefix in template"
-    if $ENV{'TEST_VERBOSE'};
+diag "non-ascii subject with non-ascii subject prefix in template";
 foreach my $set ( 'ru', 'latin1' ) {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => $string{$set}{test},
@@ -207,16 +203,15 @@ foreach my $set ( 'ru', 'latin1' ) {
 }
 
 foreach my $tag_set ( 'ru', 'latin1' ) {
-diag "set non-ascii subject tag for the queue" if $ENV{'TEST_VERBOSE'};
+diag "set non-ascii subject tag for the queue";
 {
     my ($status, $msg) = $queue->SetSubjectTag( $string{$tag_set}{support} );
     ok $status, "set subject tag for the queue" or diag "error: $msg";
 }
 
-diag "non-ascii subject, non-ascii prefix in template and non-ascii tag"
-    if $ENV{'TEST_VERBOSE'};
+diag "non-ascii subject, non-ascii prefix in template and non-ascii tag";
 foreach my $set ( 'ru', 'latin1' ) {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => $string{$set}{test},
@@ -241,7 +236,7 @@ foreach my $set ( 'ru', 'latin1' ) {
 
 } # subject tag
 
-diag "flush subject tag of the queue" if $ENV{'TEST_VERBOSE'};
+diag "flush subject tag of the queue";
 {
     my ($status, $msg) = $queue->SetSubjectTag( undef );
     ok $status, "set subject tag for the queue" or diag "error: $msg";
@@ -250,11 +245,11 @@ diag "flush subject tag of the queue" if $ENV{'TEST_VERBOSE'};
 } # prefix set
 
 
-diag "don't change subject via template" if $ENV{'TEST_VERBOSE'};
+diag "don't change subject via template";
 # clean DB has autoreply that always changes subject in template,
 # we should test situation when subject is not changed from template
 {
-    my $template = RT::Template->new( $RT::SystemUser );
+    my $template = RT::Template->new( RT->SystemUser );
     $template->Load('Autoreply');
     ok $template->id, "loaded autoreply tempalte";
 
@@ -267,9 +262,9 @@ diag "don't change subject via template" if $ENV{'TEST_VERBOSE'};
     ok $status, "changed content of the template" or diag "error: $msg";
 }
 
-diag "non-ascii Subject without changes in template" if $ENV{'TEST_VERBOSE'};
+diag "non-ascii Subject without changes in template";
 foreach my $set ( 'ru', 'latin1' ) {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => $string{$set}{test},
@@ -289,16 +284,15 @@ foreach my $set ( 'ru', 'latin1' ) {
 }
 
 foreach my $tag_set ( 'ru', 'latin1' ) {
-diag "set non-ascii subject tag for the queue" if $ENV{'TEST_VERBOSE'};
+diag "set non-ascii subject tag for the queue";
 {
     my ($status, $msg) = $queue->SetSubjectTag( $string{$tag_set}{support} );
     ok $status, "set subject tag for the queue" or diag "error: $msg";
 }
 
-diag "non-ascii Subject without changes in template and with non-ascii subject tag"
-    if $ENV{'TEST_VERBOSE'};
+diag "non-ascii Subject without changes in template and with non-ascii subject tag";
 foreach my $set ( 'ru', 'latin1' ) {
-    my $ticket = RT::Ticket->new( $RT::SystemUser );
+    my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Create(
         Queue => $queue->id,
         Subject => $string{$set}{test},
@@ -320,3 +314,4 @@ foreach my $set ( 'ru', 'latin1' ) {
 }
 
 } # subject tag set
+