From 14ecf8f177abdbc129a3c1f89808d63a38ae79d5 Mon Sep 17 00:00:00 2001
From: Dave Reid <dave@davereid.net>
Date: Thu, 7 Apr 2011 16:02:20 -0500
Subject: [PATCH] Issue #1066822: Fixed test files and getInfo() functions.

---
 feeds.info                                         |    4 +-
 feeds_import/feeds_import.test                     |   22 ++++++-----------
 feeds_news/feeds_news.test                         |   24 ++++++++-----------
 feeds_ui/tests/feeds_ui.test                       |   16 ++++---------
 tests/common_syndication_parser.test               |   12 ++++-----
 tests/{feeds.test.inc => feeds.test}               |    0
 tests/feeds_date_time.test                         |   11 +++-----
 tests/feeds_fetcher_file.test                      |   11 +++-----
 tests/{feeds_mapper_test.inc => feeds_mapper.test} |    3 --
 tests/feeds_mapper_date.test                       |    7 +++--
 tests/feeds_mapper_field.test                      |    6 ++--
 tests/feeds_mapper_file.test                       |    6 ++--
 tests/feeds_mapper_link.test                       |    9 +++----
 tests/feeds_mapper_taxonomy.test                   |    8 ++----
 tests/feeds_parser_sitemap.test                    |   14 +++--------
 tests/feeds_parser_syndication.test                |   14 +++--------
 tests/feeds_processor_node.test                    |   11 +++-----
 tests/feeds_processor_term.test                    |   11 +++-----
 tests/feeds_processor_user.test                    |   11 +++-----
 tests/feeds_scheduler.test                         |   11 +++-----
 tests/parser_csv.test                              |   11 +++-----
 21 files changed, 83 insertions(+), 139 deletions(-)
 rename tests/{feeds.test.inc => feeds.test} (100%)
 rename tests/{feeds_mapper_test.inc => feeds_mapper.test} (98%)

diff --git a/feeds.info b/feeds.info
index 0f1d600..b0b6905 100644
--- a/feeds.info
+++ b/feeds.info
@@ -8,12 +8,12 @@ files[] = feeds.install
 files[] = includes/FeedsConfigurable.inc
 files[] = includes/FeedsImporter.inc
 files[] = includes/FeedsSource.inc
-files[] = tests/feeds.test.inc
+files[] = tests/feeds.test
 files[] = tests/feeds_date_time.test
 files[] = tests/feeds_mapper_date.test
 files[] = tests/feeds_mapper_field.test
 files[] = tests/feeds_mapper_file.test
-files[] = tests/feeds_mapper_test.inc
+files[] = tests/feeds_mapper.test
 files[] = tests/feeds_fetcher_file.test
 files[] = tests/feeds_processor_node.test
 files[] = tests/feeds_processor_term.test
diff --git a/feeds_import/feeds_import.test b/feeds_import/feeds_import.test
index 68d68b7..b7d43c9 100644
--- a/feeds_import/feeds_import.test
+++ b/feeds_import/feeds_import.test
@@ -17,14 +17,11 @@ class FeedsExamplesNodeTestCase extends FeedsWebTestCase {
     parent::setUp(array('feeds_import'));
   }
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('Feature: Node import'),
-      'description' => t('Test "Node import" default configuration.'),
-      'group' => t('Feeds'),
+      'name' => 'Feature: Node import',
+      'description' => 'Test "Node import" default configuration.',
+      'group' => 'Feeds',
     );
   }
 
@@ -133,14 +130,11 @@ class FeedsExamplesUserTestCase extends FeedsWebTestCase {
     );
   }
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('Feature: User import'),
-      'description' => t('Test "User import" default configuration.'),
-      'group' => t('Feeds'),
+      'name' => 'Feature: User import',
+      'description' => 'Test "User import" default configuration.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/feeds_news/feeds_news.test b/feeds_news/feeds_news.test
index 68deb56..c77b69f 100644
--- a/feeds_news/feeds_news.test
+++ b/feeds_news/feeds_news.test
@@ -9,14 +9,12 @@
  * Test Feed configuration.
  */
 class FeedsExamplesFeedTestCase extends FeedsWebTestCase {
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+
+  public static function getInfo() {
     return array(
-      'name' => t('Feature: Feed'),
-      'description' => t('Test "Feed" default configuration.'),
-      'group' => t('Feeds'),
+      'name' => 'Feature: Feed',
+      'description' => 'Test "Feed" default configuration.',
+      'group' => 'Feeds',
     );
   }
 
@@ -88,14 +86,12 @@ class FeedsExamplesFeedTestCase extends FeedsWebTestCase {
  * Test OPML import configuration.
  */
 class FeedsExamplesOPMLTestCase extends FeedsWebTestCase {
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+
+  public static function getInfo() {
     return array(
-      'name' => t('Feature: OPML import'),
-      'description' => t('Test "OPML import" default configuration.'),
-      'group' => t('Feeds'),
+      'name' => 'Feature: OPML import',
+      'description' => 'Test "OPML import" default configuration.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/feeds_ui/tests/feeds_ui.test b/feeds_ui/tests/feeds_ui.test
index 101fbf4..81e6543 100644
--- a/feeds_ui/tests/feeds_ui.test
+++ b/feeds_ui/tests/feeds_ui.test
@@ -5,22 +5,16 @@
  * Tests for Feeds Admin UI module.
  */
 
-// Require FeedsWebTestCase class definition.
-require_once(dirname(__FILE__) .'/../../tests/feeds.test.inc');
-
 /**
  * Test basic Feeds UI functionality.
  */
 class FeedsUIUserInterfaceTestCase extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('Feeds UI user interface'),
-      'description' => t('Tests Feeds Admin UI module\'s GUI.'),
-      'group' => t('Feeds'),
+      'name' => 'Feeds UI user interface',
+      'description' => 'Tests Feeds Admin UI module\'s GUI.',
+      'group' => 'Feeds',
     );
   }
 
@@ -135,4 +129,4 @@ class FeedsUIUserInterfaceTestCase extends FeedsWebTestCase {
 
     // @todo Refreshing/deleting feed items. Needs to live in feeds.test
   }
-}
\ No newline at end of file
+}
diff --git a/tests/common_syndication_parser.test b/tests/common_syndication_parser.test
index 78aa007..3a0ef21 100644
--- a/tests/common_syndication_parser.test
+++ b/tests/common_syndication_parser.test
@@ -7,14 +7,12 @@
  * @todo Could I use DrupalUnitTestCase here?
  */
 class CommonSyndicationParserTestCase extends DrupalWebTestCase {
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+
+  public static function getInfo() {
     return array(
-      'name' => t('Common Syndication Parser'),
-      'description' => t('Unit tests for Common Syndication Parser.'),
-      'group' => t('Feeds'),
+      'name' => 'Common Syndication Parser',
+      'description' => 'Unit tests for Common Syndication Parser.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds.test.inc b/tests/feeds.test
similarity index 100%
rename from tests/feeds.test.inc
rename to tests/feeds.test
diff --git a/tests/feeds_date_time.test b/tests/feeds_date_time.test
index 3f7b602..618590f 100644
--- a/tests/feeds_date_time.test
+++ b/tests/feeds_date_time.test
@@ -15,14 +15,11 @@
 class FeedsDateTimeTest extends DrupalWebTestCase  {
   protected $profile = 'testing';
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('FeedsDateTime unit tests'),
-      'description' => t('Unit tests for Feeds date handling.'),
-      'group' => t('Feeds'),
+      'name' => 'FeedsDateTime unit tests',
+      'description' => 'Unit tests for Feeds date handling.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_fetcher_file.test b/tests/feeds_fetcher_file.test
index c6fe2e9..2af242c 100644
--- a/tests/feeds_fetcher_file.test
+++ b/tests/feeds_fetcher_file.test
@@ -10,14 +10,11 @@
  */
 class FeedsFileFetcherTestCase extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('File fetcher'),
-      'description' => t('Tests for file fetcher plugin.'),
-      'group' => t('Feeds'),
+      'name' => 'File fetcher',
+      'description' => 'Tests for file fetcher plugin.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_mapper_test.inc b/tests/feeds_mapper.test
similarity index 98%
rename from tests/feeds_mapper_test.inc
rename to tests/feeds_mapper.test
index 17a06c1..31f3335 100644
--- a/tests/feeds_mapper_test.inc
+++ b/tests/feeds_mapper.test
@@ -5,9 +5,6 @@
  * Helper class with auxiliary functions for feeds mapper module tests.
  */
 
-// Require FeedsWebTestCase class definition.
-require_once(dirname(__FILE__) .'/feeds.test.inc');
-
 /**
  * Base class for implementing Feeds Mapper test cases.
  */
diff --git a/tests/feeds_mapper_date.test b/tests/feeds_mapper_date.test
index b78ec3d..d9fdc74 100644
--- a/tests/feeds_mapper_date.test
+++ b/tests/feeds_mapper_date.test
@@ -15,9 +15,10 @@ class FeedsMapperDateTestCase extends FeedsMapperTestCase {
 
   public static function getInfo() {
     return array(
-      'name' => t('Mapper: Date'),
-      'description' => t('Test Feeds Mapper support for CCK Date fields. <strong>Requires CCK and Date module</strong>.'),
-      'group' => t('Feeds'),
+      'name' => 'Mapper: Date',
+      'description' => 'Test Feeds Mapper support for CCK Date fields.',
+      'group' => 'Feeds',
+      'dependencies' => array('date'),
     );
   }
 
diff --git a/tests/feeds_mapper_field.test b/tests/feeds_mapper_field.test
index 0f31fb9..71c5ef3 100644
--- a/tests/feeds_mapper_field.test
+++ b/tests/feeds_mapper_field.test
@@ -12,9 +12,9 @@ class FeedsMapperFieldTestCase extends FeedsMapperTestCase {
 
   public static function getInfo() {
     return array(
-      'name' => t('Mapper: Fields'),
-      'description' => t('Test Feeds Mapper support for fields.'),
-      'group' => t('Feeds'),
+      'name' => 'Mapper: Fields',
+      'description' => 'Test Feeds Mapper support for fields.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_mapper_file.test b/tests/feeds_mapper_file.test
index 80d31ce..0436c75 100644
--- a/tests/feeds_mapper_file.test
+++ b/tests/feeds_mapper_file.test
@@ -16,9 +16,9 @@ class FeedsMapperFileTestCase extends FeedsMapperTestCase {
 
   public static function getInfo() {
     return array(
-      'name' => t('Mapper: File field'),
-      'description' => t('Test Feeds Mapper support for file fields. <strong>Requires SimplePie library</strong>.'),
-      'group' => t('Feeds'),
+      'name' => 'Mapper: File field',
+      'description' => 'Test Feeds Mapper support for file fields. <strong>Requires SimplePie library</strong>.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_mapper_link.test b/tests/feeds_mapper_link.test
index 4c85247..4b82e01 100644
--- a/tests/feeds_mapper_link.test
+++ b/tests/feeds_mapper_link.test
@@ -5,8 +5,6 @@
  * Test case for CCK link mapper mappers/date.inc.
  */
 
-require_once(drupal_get_path('module', 'feeds') . '/tests/feeds_mapper_test.inc');
-
 /**
  * Class for testing Feeds <em>link</em> mapper.
  */
@@ -14,9 +12,10 @@ class FeedsMapperLinkTestCase extends FeedsMapperTestCase {
 
   public static function getInfo() {
     return array(
-      'name' => t('Mapper: Link'),
-      'description' => t('Test Feeds Mapper support for Link fields. <strong>Requires Link module</strong>.'),
-      'group' => t('Feeds'),
+      'name' => 'Mapper: Link',
+      'description' => 'Test Feeds Mapper support for Link fields.',
+      'group' => 'Feeds',
+      'dependencies' => array('link'),
     );
   }
 
diff --git a/tests/feeds_mapper_taxonomy.test b/tests/feeds_mapper_taxonomy.test
index 5586285..e0f5956 100644
--- a/tests/feeds_mapper_taxonomy.test
+++ b/tests/feeds_mapper_taxonomy.test
@@ -5,8 +5,6 @@
  * Test case for taxonomy mapper mappers/taxonomy.inc.
  */
 
-require_once(drupal_get_path('module', 'feeds') . '/tests/feeds_mapper_test.inc');
-
 /**
  * Class for testing Feeds <em>content</em> mapper.
  */
@@ -14,9 +12,9 @@ class FeedsMapperTaxonomyTestCase extends FeedsMapperTestCase {
 
   public static function getInfo() {
     return array(
-      'name' => t('Mapper: Taxonomy'),
-      'description' => t('Test Feeds Mapper support for Taxonomy.'),
-      'group' => t('Feeds'),
+      'name' => 'Mapper: Taxonomy',
+      'description' => 'Test Feeds Mapper support for Taxonomy.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_parser_sitemap.test b/tests/feeds_parser_sitemap.test
index ae92efb..a6206c9 100644
--- a/tests/feeds_parser_sitemap.test
+++ b/tests/feeds_parser_sitemap.test
@@ -5,22 +5,16 @@
  * Tests for plugins/FeedsSitemapParser.inc
  */
 
-// Require FeedsWebTestCase class definition.
-require_once(dirname(__FILE__) .'/feeds.test.inc');
-
 /**
  * Test Sitemap parser.
  */
 class FeedsSitemapParserTestCase extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('Sitemap parser'),
-      'description' => t('Regression tests for Sitemap XML format parser.'),
-      'group' => t('Feeds'),
+      'name' => 'Sitemap parser',
+      'description' => 'Regression tests for Sitemap XML format parser.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_parser_syndication.test b/tests/feeds_parser_syndication.test
index 845e5d4..5079499 100644
--- a/tests/feeds_parser_syndication.test
+++ b/tests/feeds_parser_syndication.test
@@ -5,22 +5,16 @@
  * Tests for plugins/FeedsSyndicationParser.inc.
  */
 
-// Require FeedsWebTestCase class definition.
-require_once(dirname(__FILE__) .'/feeds.test.inc');
-
 /**
  * Test single feeds.
  */
 class FeedsSyndicationParserTestCase extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('Syndication parsers'),
-      'description' => t('Regression tests for syndication parsers Common syndication and SimplePie. Tests parsers against a set of feeds in the context of Feeds module. <strong>Requires SimplePie parser to be configured correctly.</strong>'),
-      'group' => t('Feeds'),
+      'name' => 'Syndication parsers',
+      'description' => 'Regression tests for syndication parsers Common syndication and SimplePie. Tests parsers against a set of feeds in the context of Feeds module. <strong>Requires SimplePie parser to be configured correctly.</strong>',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_processor_node.test b/tests/feeds_processor_node.test
index cb29787..068c4c5 100644
--- a/tests/feeds_processor_node.test
+++ b/tests/feeds_processor_node.test
@@ -10,14 +10,11 @@
  */
 class FeedsRSStoNodesTest extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('RSS import to nodes'),
-      'description' => t('Tests a feed configuration that is attached to a content type, uses HTTP fetcher, common syndication parser and a node processor. Repeats the same test for an importer configuration that is not attached to a content type and for a configuration that is attached to a content type and uses the file fetcher.'),
-      'group' => t('Feeds'),
+      'name' => 'RSS import to nodes',
+      'description' => 'Tests a feed configuration that is attached to a content type, uses HTTP fetcher, common syndication parser and a node processor. Repeats the same test for an importer configuration that is not attached to a content type and for a configuration that is attached to a content type and uses the file fetcher.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_processor_term.test b/tests/feeds_processor_term.test
index e86b08f..c663a8b 100644
--- a/tests/feeds_processor_term.test
+++ b/tests/feeds_processor_term.test
@@ -10,14 +10,11 @@
  */
 class FeedsCSVtoTermsTest extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('CSV import to taxonomy'),
-      'description' => t('Tests a standalone import configuration that uses file fetcher and CSV parser to import taxonomy terms from a CSV file.'),
-      'group' => t('Feeds'),
+      'name' => 'CSV import to taxonomy',
+      'description' => 'Tests a standalone import configuration that uses file fetcher and CSV parser to import taxonomy terms from a CSV file.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_processor_user.test b/tests/feeds_processor_user.test
index 03da61b..3272b99 100644
--- a/tests/feeds_processor_user.test
+++ b/tests/feeds_processor_user.test
@@ -10,14 +10,11 @@
  */
 class FeedsCSVtoUsersTest extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('CSV import to users'),
-      'description' => t('Tests a standalone import configuration that uses file fetcher and CSV parser to import users from a CSV file.'),
-      'group' => t('Feeds'),
+      'name' => 'CSV import to users',
+      'description' => 'Tests a standalone import configuration that uses file fetcher and CSV parser to import users from a CSV file.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/feeds_scheduler.test b/tests/feeds_scheduler.test
index b11560a..07320bd 100644
--- a/tests/feeds_scheduler.test
+++ b/tests/feeds_scheduler.test
@@ -10,14 +10,11 @@
  */
 class FeedsSchedulerTestCase extends FeedsWebTestCase {
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('Scheduler'),
-      'description' => t('Tests for feeds scheduler.'),
-      'group' => t('Feeds'),
+      'name' => 'Scheduler',
+      'description' => 'Tests for feeds scheduler.',
+      'group' => 'Feeds',
     );
   }
 
diff --git a/tests/parser_csv.test b/tests/parser_csv.test
index 8ef0087..d908b07 100644
--- a/tests/parser_csv.test
+++ b/tests/parser_csv.test
@@ -15,14 +15,11 @@
 class ParserCSVTest extends DrupalWebTestCase  {
   protected $profile = 'testing';
 
-  /**
-   * Describe this test.
-   */
-  public function getInfo() {
+  public static function getInfo() {
     return array(
-      'name' => t('CSV Parser unit tests'),
-      'description' => t('Base level test for Feeds\' built in CSV parser.'),
-      'group' => t('Feeds'),
+      'name' => 'CSV Parser unit tests',
+      'description' => 'Base level test for Feeds\' built in CSV parser.',
+      'group' => 'Feeds',
     );
   }
 
-- 
1.7.1

