[Rt-commit] r14665 - in rtfm/trunk: .

falcone at bestpractical.com falcone at bestpractical.com
Wed Jul 30 16:06:50 EDT 2008


Author: falcone
Date: Wed Jul 30 16:06:45 2008
New Revision: 14665

Modified:
   rtfm/trunk/   (props changed)
   rtfm/trunk/t/05cfsearch.t
   rtfm/trunk/t/3upload-customfields.t
   rtfm/trunk/t/ArticleCollection_Overlay.pm.t
   rtfm/trunk/t/Article_Overlay.pm.t
   rtfm/trunk/t/Class_Overlay.pm.t
   rtfm/trunk/t/URI_a.t
   rtfm/trunk/t/URI_fsck_com_rtfm.t

Log:
 r36397 at ketch:  falcone | 2008-07-30 12:13:06 -0400
 * move to using RT::Test


Modified: rtfm/trunk/t/05cfsearch.t
==============================================================================
--- rtfm/trunk/t/05cfsearch.t	(original)
+++ rtfm/trunk/t/05cfsearch.t	Wed Jul 30 16:06:45 2008
@@ -11,23 +11,21 @@
 
 {
 my ($ret, $msg) = $RT::Handle->InsertSchema(undef,'etc/');
-ok($ret,"Created Schema: ".$msg||'');
+ok($ret,"Created Schema: ".($msg||''));
 ($ret, $msg) = $RT::Handle->InsertACL(undef,'etc/');
-ok($ret,"Created ACL: ".$msg||'');
+ok($ret,"Created ACL: ".($msg||''));
 }
 
 RT->Config->Set('Plugins',qw(RT::FM));
 
 my $suffix = '-'. $$;
 
-my $CurrentUser = $RT::SystemUser;
-
 use_ok 'RT::FM::Class';
 use_ok 'RT::FM::Article';
 use_ok 'RT::CustomField';
 
 my $classname = 'TestClass';
-my $class = RT::FM::Class->new( $CurrentUser );
+my $class = RT::FM::Class->new( $RT::SystemUser );
 {
     $class->Load( $classname );
     unless ( $class->Id ) {
@@ -44,7 +42,7 @@
 
 # create cf
 my $cfname = 'TestCF'. $suffix;
-my $cf = RT::CustomField->new( $CurrentUser );
+my $cf = RT::CustomField->new( $RT::SystemUser );
 {
     my ($id, $msg) = $cf->Create(
         Name => $cfname,
@@ -73,18 +71,18 @@
 }
 
 my $article1name = 'TestArticle1'.$suffix;
-my $article1 = new RT::FM::Article($CurrentUser);
+my $article1 = new RT::FM::Article($RT::SystemUser);
 $article1->Create( Name => $article1name, Summary => 'Test', Class => $class->Id);
 $article1->AddCustomFieldValue(Field => $cf->Id, Value => 'Value1');
 
 my $article2name = 'TestArticle2'.$suffix;
-my $article2 = new RT::FM::Article($CurrentUser);
+my $article2 = new RT::FM::Article($RT::SystemUser);
 $article2->Create( Name => $article2name, Summary => 'Test', Class => $class->Id);
 $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 
 # search for articles containing 1st value
 {
-    my $articles = RT::FM::ArticleCollection->new( $CurrentUser );
+    my $articles = RT::FM::ArticleCollection->new( $RT::SystemUser );
     $articles->UnLimit;
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf->Id, VALUE => 'Value1' );
@@ -92,7 +90,7 @@
 }
 
 {
-    my $articles = new RT::FM::ArticleCollection($CurrentUser);
+    my $articles = new RT::FM::ArticleCollection($RT::SystemUser);
     $articles->UnLimit;
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf, VALUE => 'Value1' );    
@@ -100,7 +98,7 @@
 }
 
 {
-    my $articles = new RT::FM::ArticleCollection($CurrentUser);
+    my $articles = new RT::FM::ArticleCollection($RT::SystemUser);
     $articles->UnLimit( );
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf->Name, VALUE => 'Value1' );

Modified: rtfm/trunk/t/3upload-customfields.t
==============================================================================
--- rtfm/trunk/t/3upload-customfields.t	(original)
+++ rtfm/trunk/t/3upload-customfields.t	Wed Jul 30 16:06:45 2008
@@ -86,6 +86,7 @@
 my @names = map  { $_->[1] }
             sort { $a->[0] <=> $b->[0] }
             map  { /Object-1-CF-(\d+)/ ? [ $1 => $_ ] : () }
+            grep { $_ }
             map  $_->name, $m->current_form->inputs;
 my $tcf = pop(@names);
 $m->field( $tcf => 1 );         # Associate the new CF with this queue

Modified: rtfm/trunk/t/ArticleCollection_Overlay.pm.t
==============================================================================
--- rtfm/trunk/t/ArticleCollection_Overlay.pm.t	(original)
+++ rtfm/trunk/t/ArticleCollection_Overlay.pm.t	Wed Jul 30 16:06:45 2008
@@ -3,12 +3,19 @@
 use strict;
 use warnings;
 
-use Test::More tests => 31;
-BEGIN { require 't/utils.pl' }
+use Test::More;
+eval 'use RT::Test; 1'
+    or plan skip_all => 'requires 3.8 to run tests.';
+plan tests => 32;
+
+{
+my ($ret, $msg) = $RT::Handle->InsertSchema(undef,'etc/');
+ok($ret,"Created Schema: ".($msg||''));
+($ret, $msg) = $RT::Handle->InsertACL(undef,'etc/');
+ok($ret,"Created ACL: ".($msg||''));
+}
 
-use_ok 'RT';
-RT::LoadConfig();
-RT::Init();
+RT->Config->Set('Plugins',qw(RT::FM));
 
 use_ok 'RT::FM::ArticleCollection';
 use_ok 'RT::FM::ClassCollection';

Modified: rtfm/trunk/t/Article_Overlay.pm.t
==============================================================================
--- rtfm/trunk/t/Article_Overlay.pm.t	(original)
+++ rtfm/trunk/t/Article_Overlay.pm.t	Wed Jul 30 16:06:45 2008
@@ -3,12 +3,19 @@
 use strict;
 use warnings;
 
-use Test::More tests => 69;
-BEGIN { require 't/utils.pl' }
+use Test::More; 
+eval 'use RT::Test; 1'
+    or plan skip_all => 'requires 3.8 to run tests.';
+plan tests => 70;
+
+{
+my ($ret, $msg) = $RT::Handle->InsertSchema(undef,'etc/');
+ok($ret,"Created Schema: ".($msg||''));
+($ret, $msg) = $RT::Handle->InsertACL(undef,'etc/');
+ok($ret,"Created ACL: ".($msg||''));
+}
 
-use_ok 'RT';
-RT::LoadConfig();
-RT::Init();
+RT->Config->Set('Plugins',qw(RT::FM));
 
 use_ok 'RT::FM::ArticleCollection';
 use_ok 'RT::FM::ClassCollection';

Modified: rtfm/trunk/t/Class_Overlay.pm.t
==============================================================================
--- rtfm/trunk/t/Class_Overlay.pm.t	(original)
+++ rtfm/trunk/t/Class_Overlay.pm.t	Wed Jul 30 16:06:45 2008
@@ -3,12 +3,19 @@
 use strict;
 use warnings;
 
-use Test::More tests => 14;
-BEGIN { require 't/utils.pl' }
+use Test::More;
+eval 'use RT::Test; 1'
+    or plan skip_all => 'requires 3.8 to run tests.';
+plan tests => 15;
+
+{
+my ($ret, $msg) = $RT::Handle->InsertSchema(undef,'etc/');
+ok($ret,"Created Schema: ".($msg||''));
+($ret, $msg) = $RT::Handle->InsertACL(undef,'etc/');
+ok($ret,"Created ACL: ".($msg||''));
+}
 
-use_ok 'RT';
-RT::LoadConfig();
-RT::Init();
+RT->Config->Set('Plugins',qw(RT::FM));
 
 use_ok 'RT::FM::ArticleCollection';
 use_ok 'RT::FM::ClassCollection';

Modified: rtfm/trunk/t/URI_a.t
==============================================================================
--- rtfm/trunk/t/URI_a.t	(original)
+++ rtfm/trunk/t/URI_a.t	Wed Jul 30 16:06:45 2008
@@ -3,12 +3,19 @@
 use strict;
 use warnings;
 
-use Test::More tests => 8;
-BEGIN { require 't/utils.pl' }
+use Test::More;
+eval 'use RT::Test; 1'
+    or plan skip_all => 'requires 3.8 to run tests.';
+plan tests => 9;
 
-use_ok 'RT';
-RT::LoadConfig();
-RT::Init();
+{
+my ($ret, $msg) = $RT::Handle->InsertSchema(undef,'etc/');
+ok($ret,"Created Schema: ".($msg||''));
+($ret, $msg) = $RT::Handle->InsertACL(undef,'etc/');
+ok($ret,"Created ACL: ".($msg||''));
+}
+
+RT->Config->Set('Plugins',qw(RT::FM));
 
 use_ok("RT::URI::a");
 my $uri = RT::URI::a->new($RT::SystemUser);

Modified: rtfm/trunk/t/URI_fsck_com_rtfm.t
==============================================================================
--- rtfm/trunk/t/URI_fsck_com_rtfm.t	(original)
+++ rtfm/trunk/t/URI_fsck_com_rtfm.t	Wed Jul 30 16:06:45 2008
@@ -3,12 +3,19 @@
 use strict;
 use warnings;
 
-use Test::More tests => 10;
-BEGIN { require 't/utils.pl' }
+use Test::More;
+eval 'use RT::Test; 1'
+    or plan skip_all => 'requires 3.8 to run tests.';
+plan tests => 11;
+
+{
+my ($ret, $msg) = $RT::Handle->InsertSchema(undef,'etc/');
+ok($ret,"Created Schema: ".($msg||''));
+($ret, $msg) = $RT::Handle->InsertACL(undef,'etc/');
+ok($ret,"Created ACL: ".($msg||''));
+}
 
-use_ok 'RT';
-RT::LoadConfig();
-RT::Init();
+RT->Config->Set('Plugins',qw(RT::FM));
 
 use_ok "RT::URI::fsck_com_rtfm";
 my $uri = RT::URI::fsck_com_rtfm->new( $RT::SystemUser );


More information about the Rt-commit mailing list