[Rt-commit] rt branch, 3.9-merge-rtfm, updated. rt-3.9.6-1066-gd91ee36

Shawn Moore sartak at bestpractical.com
Thu Dec 2 21:32:12 EST 2010


The branch, 3.9-merge-rtfm has been updated
       via  d91ee36d4cbd3b1b93ca24c931f5d5156e69a992 (commit)
      from  7c11d3aa2d4e151afac24b92f55c21c6fb634f60 (commit)

Summary of changes:
 etc/rtfm/upgrade/migrate-2.0-to-2.1        |    4 +-
 share/html/Search/Elements/Article         |    4 +-
 share/html/SelfService/Article/Search.html |    6 ++--
 t/articles/article.t                       |    8 +++---
 t/articles/articles.t                      |   34 ++++++++++++++--------------
 t/articles/cfsearch.t                      |    6 ++--
 t/articles/class.t                         |    2 +-
 7 files changed, 32 insertions(+), 32 deletions(-)

- Log -----------------------------------------------------------------
commit d91ee36d4cbd3b1b93ca24c931f5d5156e69a992
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Dec 2 21:32:00 2010 -0500

    ArticleCollection -> Articles

diff --git a/etc/rtfm/upgrade/migrate-2.0-to-2.1 b/etc/rtfm/upgrade/migrate-2.0-to-2.1
index 000577f..c74f1f7 100644
--- a/etc/rtfm/upgrade/migrate-2.0-to-2.1
+++ b/etc/rtfm/upgrade/migrate-2.0-to-2.1
@@ -202,8 +202,8 @@ while ( my $cf = $cfs->Next ) {
 }
 
 # Find all articles
-    use RT::FM::ArticleCollection;
-my $articles = RT::FM::ArticleCollection->new($RT::SystemUser);
+    use RT::FM::Articles;
+my $articles = RT::FM::Articles->new($RT::SystemUser);
 $articles->UnLimit();
 
 #
diff --git a/share/html/Search/Elements/Article b/share/html/Search/Elements/Article
index 18b948e..b32992e 100644
--- a/share/html/Search/Elements/Article
+++ b/share/html/Search/Elements/Article
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <& /Elements/CollectionList, %ARGS, 
     Collection => $articles, 
-    Class => 'RT::ArticleCollection',
+    Class => 'RT::Articles',
     Format => q{
     '<a href="/Articles/Article/Display.html?id=__id__">__id__</a>/TITLE:#',
     '<a href="/Articles/Article/Display.html?id=__id__">__Name__</a>/TITLE:Name',
@@ -59,6 +59,6 @@
     &>
 <%INIT>
 my $QueryString = "?".$m->comp('/Elements/QueryString', %{$ARGS{args}});
-my $articles = RT::FM::ArticleCollection->new( $session{CurrentUser} );
+my $articles = RT::FM::Articles->new( $session{CurrentUser} );
 $articles->Search( %{$ARGS{args}} );
 </%INIT>
diff --git a/share/html/SelfService/Article/Search.html b/share/html/SelfService/Article/Search.html
index 68e81cd..dc5fef9 100644
--- a/share/html/SelfService/Article/Search.html
+++ b/share/html/SelfService/Article/Search.html
@@ -86,10 +86,10 @@
 % }
 </table>
 <%init>
-use RT::FM::ArticleCollection;
+use RT::FM::Articles;
 
-my $articles_content = RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
-my $articles_basics = RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
+my $articles_content = RT::FM::Articles->new( $session{'CurrentUser'} );
+my $articles_basics = RT::FM::Articles->new( $session{'CurrentUser'} );
 if ( $ARGS{'Articles_Content'} ) {
     $articles_content->LimitCustomField( VALUE => $ARGS{'Articles_Content'},
                                                 OPERATOR => 'LIKE' );
diff --git a/t/articles/article.t b/t/articles/article.t
index 569297c..bc84eb1 100644
--- a/t/articles/article.t
+++ b/t/articles/article.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT::Test tests => 70;
 
-use_ok 'RT::FM::ArticleCollection';
+use_ok 'RT::FM::Articles';
 use_ok 'RT::FM::ClassCollection';
 use_ok 'RT::FM::Class';
 
@@ -148,10 +148,10 @@ ok ($tix->First->Id == $tick->id, "It's even the right one");
 
 
 # Find all articles which refer to Ticket 1
-use RT::FM::ArticleCollection;
+use RT::FM::Articles;
 
-my $articles = RT::FM::ArticleCollection->new($RT::SystemUser);
-ok($articles->isa('RT::FM::ArticleCollection'), "Created an article collection");
+my $articles = RT::FM::Articles->new($RT::SystemUser);
+ok($articles->isa('RT::FM::Articles'), "Created an article collection");
 ok($articles->isa('RT::SearchBuilder'), "Created an article collection");
 ok($articles->isa('DBIx::SearchBuilder'), "Created an article collection");
 ok($tick->URI, "The ticket does still have a URI");
diff --git a/t/articles/articles.t b/t/articles/articles.t
index c26ea65..1c20db4 100644
--- a/t/articles/articles.t
+++ b/t/articles/articles.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT::Test tests => 32;
 
-use_ok 'RT::FM::ArticleCollection';
+use_ok 'RT::FM::Articles';
 use_ok 'RT::FM::ClassCollection';
 use_ok 'RT::FM::Class';
 
@@ -49,21 +49,21 @@ ok( $id, $msg );
 
 
 
-my $arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+my $arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitName( VALUE => 'Collection-1-' . $$ . 'fake' );
 is( $arts->Count, 0,
     "Found no artlcles with names matching something that is not there" );
 
-my $arts2 = RT::FM::ArticleCollection->new($RT::SystemUser);
+my $arts2 = RT::FM::Articles->new($RT::SystemUser);
 $arts2->LimitName( VALUE => 'Collection-1-' . $$ );
 is( $arts2->Count, 1, 'Found one with names matching the word "test"' );
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitSummary( VALUE => 'Coll-1-' . $$ . 'fake' );
 is( $arts->Count, 0,
     'Found no artlcles with summarys matching something that is not there' );
 
-$arts2 = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts2 = RT::FM::Articles->new($RT::SystemUser);
 $arts2->LimitSummary( VALUE => 'Coll-1-' . $$ );
 is( $arts2->Count, 1, 'Found one with summarys matching the word "Coll-1"' );
 
@@ -77,34 +77,34 @@ my $new_art = RT::FM::Article->new($RT::SystemUser);
 ok( $id, $msg . " Created a second testable article" );
 
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitCustomField( OPERATOR => 'LIKE', VALUE => "esting".$$ );
 is( $arts->Count, 1, "Found 1 cf values matching 'esting" . $$ . "' for an unspecified field");
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitCustomField( OPERATOR => '=', VALUE => "esting".$$ );
 is( $arts->Count, 0, "Found 0 cf values EXACTLY matching 'esting" . $$ . "' for an unspecified field");
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitCustomField( OPERATOR => '=', VALUE => "testing".$$ );
 is( $arts->Count, 1, "Found 0 cf values EXACTLY matching 'testing" . $$ . "' for an unspecified field");
 
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitCustomField( OPERATOR => 'LIKE', VALUE => $$ );
 is( $arts->Count, 2, "Found 1 cf values matching '" . $$ . "' for an unspecified field");
 
 
 # Test searching on named custom fields
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitCustomField( OPERATOR => 'LIKE', VALUE => $$, FIELD => $cf->Name );
 is( $arts->Count, 2, "Found 1 Article with cf values matching '".$$."' for CF named " .$cf->Name);
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->LimitCustomField( OPERATOR => 'LIKE', VALUE => $$, FIELD => 'NO-SUCH-CF' );
 is( $arts->Count,0, "Found no cf values matching '".$$."' for CF 'NO-SUCH-CF'  " );
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->Limit(FIELD =>'Class', VALUE => $class->id);
         
 $arts->LimitCustomField(
@@ -116,22 +116,22 @@ is(
     $arts->Count ,2,
     "Found 1 articles with custom field values not matching blah");
 
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->Limit(FIELD =>'Class', VALUE => $class->id);
 $arts->LimitCustomField( OPERATOR => 'NOT LIKE', VALUE => 'est', FIELD => $cf->id );
 is( $arts->Count , 0, "Found 0 cf values not matching 'est' for CF  ".$cf->id. " " . join(',', map {$_->id} @{$arts->ItemsArrayRef}));
-$arts = RT::FM::ArticleCollection->new($RT::SystemUser);
+$arts = RT::FM::Articles->new($RT::SystemUser);
 $arts->Limit(FIELD =>'Class', VALUE => $class->id);
 $arts->LimitCustomField( OPERATOR => 'NOT LIKE', VALUE => 'BOGUS', FIELD => $cf->id );
 is( $arts->Count , 2, "Found 2 articles not matching 'BOGUS' for CF  ".$cf->id);
 
-my $ac = RT::FM::ArticleCollection->new($RT::SystemUser);
-ok( $ac->isa('RT::FM::ArticleCollection') );
+my $ac = RT::FM::Articles->new($RT::SystemUser);
+ok( $ac->isa('RT::FM::Articles') );
 ok( $ac->isa('DBIx::SearchBuilder') );
 ok( $ac->LimitRefersTo('http://dead.link') );
 ok( $ac->Count == 0 );
 
-$ac = RT::FM::ArticleCollection->new($RT::SystemUser);
+$ac = RT::FM::Articles->new($RT::SystemUser);
 ok( $ac->LimitReferredToBy('http://dead.link') );
 ok( $ac->Count == 0 );
 
diff --git a/t/articles/cfsearch.t b/t/articles/cfsearch.t
index 9b4719c..9d27abe 100644
--- a/t/articles/cfsearch.t
+++ b/t/articles/cfsearch.t
@@ -69,7 +69,7 @@ $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 
 # search for articles containing 1st value
 {
-    my $articles = RT::FM::ArticleCollection->new( $RT::SystemUser );
+    my $articles = RT::FM::Articles->new( $RT::SystemUser );
     $articles->UnLimit;
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf->Id, VALUE => 'Value1' );
@@ -77,7 +77,7 @@ $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 }
 
 {
-    my $articles = new RT::FM::ArticleCollection($RT::SystemUser);
+    my $articles = new RT::FM::Articles($RT::SystemUser);
     $articles->UnLimit;
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf, VALUE => 'Value1' );    
@@ -85,7 +85,7 @@ $article2->AddCustomFieldValue(Field => $cf->Id, Value => 'Value2');
 }
 
 {
-    my $articles = new RT::FM::ArticleCollection($RT::SystemUser);
+    my $articles = new RT::FM::Articles($RT::SystemUser);
     $articles->UnLimit( );
     $articles->Limit( FIELD => "Class", SUBCLAUSE => 'ClassMatch', VALUE => $class->Id);
     $articles->LimitCustomField( FIELD => $cf->Name, VALUE => 'Value1' );
diff --git a/t/articles/class.t b/t/articles/class.t
index 9ce5bd3..4f04604 100644
--- a/t/articles/class.t
+++ b/t/articles/class.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT::Test tests => 16;
 
-use_ok 'RT::FM::ArticleCollection';
+use_ok 'RT::FM::Articles';
 use_ok 'RT::FM::ClassCollection';
 use_ok 'RT::FM::Class';
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list