From 6b025a7d27a054a5bbb69f048355e357b3297a4a Mon Sep 17 00:00:00 2001 From: Lars Toomre Date: Fri, 12 Oct 2012 13:47:37 -0400 Subject: [PATCH] Issue 1807556-10 by Lars Toomre: Further clean up of API docs for Aggregator module. --- core/modules/aggregator/aggregator.admin.inc | 30 ++++++---- core/modules/aggregator/aggregator.api.php | 4 +- core/modules/aggregator/aggregator.install | 2 +- core/modules/aggregator/aggregator.module | 10 ++-- core/modules/aggregator/aggregator.pages.inc | 61 +++++++++++++++----- core/modules/aggregator/aggregator.parser.inc | 1 + core/modules/aggregator/aggregator.processor.inc | 6 ++ core/modules/aggregator/aggregator.theme-rtl.css | 4 + core/modules/aggregator/aggregator.theme.css | 4 + .../Drupal/aggregator/Plugin/FetcherInterface.php | 1 + .../lib/Drupal/aggregator/Tests/AddFeedTest.php | 5 +- .../Tests/AggregatorConfigurationTest.php | 4 +- .../Drupal/aggregator/Tests/AggregatorCronTest.php | 6 ++- .../aggregator/Tests/AggregatorRenderingTest.php | 10 ++- .../Drupal/aggregator/Tests/AggregatorTestBase.php | 52 +++++++++++------ .../aggregator/Tests/CategorizeFeedItemTest.php | 6 ++ .../Drupal/aggregator/Tests/CategorizeFeedTest.php | 6 ++- .../lib/Drupal/aggregator/Tests/FeedParserTest.php | 7 +- .../lib/Drupal/aggregator/Tests/ImportOpmlTest.php | 13 +++- .../Drupal/aggregator/Tests/RemoveFeedItemTest.php | 6 ++- .../lib/Drupal/aggregator/Tests/RemoveFeedTest.php | 6 ++- .../Drupal/aggregator/Tests/UpdateFeedItemTest.php | 7 ++- .../lib/Drupal/aggregator/Tests/UpdateFeedTest.php | 7 ++- 23 files changed, 187 insertions(+), 71 deletions(-) diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc index a859e85..e978d81 100644 --- a/core/modules/aggregator/aggregator.admin.inc +++ b/core/modules/aggregator/aggregator.admin.inc @@ -92,13 +92,14 @@ function aggregator_view() { * Form constructor for adding and editing feed sources. * * @param $feed - * If editing a feed, the feed to edit as a PHP stdClass value; if adding a - * new feed, NULL. + * (optional) If editing a feed, the feed to edit as a PHP stdClass value; if + * adding a new feed, NULL. Defaults to NULL. * - * @ingroup forms - * @see aggregator_menu() - * @see aggregator_form_feed_validate() * @see aggregator_form_feed_submit() + * @see aggregator_form_feed_validate() + * @see aggregator_menu() + * + * @ingroup forms */ function aggregator_form_feed($form, &$form_state, stdClass $feed = NULL) { $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval'); @@ -199,6 +200,7 @@ function aggregator_form_feed_validate($form, &$form_state) { * Form submission handler for aggregator_form_feed(). * * @see aggregator_form_feed_validate() + * * @todo Add delete confirmation dialog. */ function aggregator_form_feed_submit($form, &$form_state) { @@ -277,10 +279,11 @@ function aggregator_admin_remove_feed_submit($form, &$form_state) { /** * Form constructor for importing feeds from OPML. * - * @ingroup forms - * @see aggregator_menu() - * @see aggregator_form_opml_validate() * @see aggregator_form_opml_submit() + * @see aggregator_form_opml_validate() + * @see aggregator_menu() + * + * @ingroup forms */ function aggregator_form_opml($form, &$form_state) { $period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200), 'format_interval'); @@ -455,8 +458,9 @@ function aggregator_admin_refresh_feed($feed) { /** * Form constructor for the aggregator system settings. * - * @see aggregator_menu() * @see aggregator_admin_form_submit() + * @see aggregator_menu() + * * @ingroup forms */ function aggregator_admin_form($form, $form_state) { @@ -586,10 +590,11 @@ function aggregator_admin_form_submit($form, &$form_state) { * - description: A string to use for the category description. * - cid: The category ID. * - * @ingroup forms - * @see aggregator_menu() - * @see aggregator_form_category_validate() * @see aggregator_form_category_submit() + * @see aggregator_form_category_validate() + * @see aggregator_menu() + * + * @ingroup forms */ function aggregator_form_category($form, &$form_state, $edit = array('title' => '', 'description' => '', 'cid' => NULL)) { $form['title'] = array('#type' => 'textfield', @@ -636,6 +641,7 @@ function aggregator_form_category_validate($form, &$form_state) { * Form submission handler for aggregator_form_category(). * * @see aggregator_form_category_validate() + * * @todo Add delete confirmation dialog. */ function aggregator_form_category_submit($form, &$form_state) { diff --git a/core/modules/aggregator/aggregator.api.php b/core/modules/aggregator/aggregator.api.php index a6cb1c5..632b3af 100644 --- a/core/modules/aggregator/aggregator.api.php +++ b/core/modules/aggregator/aggregator.api.php @@ -73,8 +73,8 @@ function hook_aggregator_fetch_info() { * @return * TRUE if parsing was successful, FALSE otherwise. * - * @see hook_aggregator_parse_info() * @see hook_aggregator_fetch() + * @see hook_aggregator_parse_info() * @see hook_aggregator_process() * * @ingroup aggregator @@ -131,9 +131,9 @@ function hook_aggregator_parse_info() { * $feed->items array. For the exact format refer to the particular parser in * use. * - * @see hook_aggregator_process_info() * @see hook_aggregator_fetch() * @see hook_aggregator_parse() + * @see hook_aggregator_process_info() * * @ingroup aggregator */ diff --git a/core/modules/aggregator/aggregator.install b/core/modules/aggregator/aggregator.install index bc0a369..96b5559 100644 --- a/core/modules/aggregator/aggregator.install +++ b/core/modules/aggregator/aggregator.install @@ -259,7 +259,7 @@ function aggregator_schema() { } /** - * Moves aggregator settings from variables to config. + * Move aggregator settings from variables to config. * * @ingroup config_upgrade */ diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 047026a..c2c7e26 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -267,13 +267,13 @@ function aggregator_menu() { } /** - * Title callback: Returns a title for aggregatory category pages. + * Title callback: Returns a title for aggregator category pages. * * @param $category * An aggregator category. * * @return - * An aggregator category title. + * A string with the aggregator category title. */ function _aggregator_category_title($category) { return $category['title']; @@ -739,7 +739,7 @@ function theme_aggregator_block_item($variables) { } /** - * Safely renders HTML content, as allowed. + * Renders the HTML content safely, as allowed. * * @param $value * The content to be filtered. @@ -755,7 +755,7 @@ function aggregator_filter_xss($value) { * Checks and sanitizes the aggregator configuration. * * Goes through all fetchers, parsers and processors and checks whether they - * are available. If one is missing resets to standard configuration. + * are available. If one is missing, resets to standard configuration. * * @return * TRUE if this function resets the configuration; FALSE if not. @@ -794,7 +794,7 @@ function aggregator_sanitize_configuration() { * Items count. * * @return - * Plural-formatted "@count items" + * A string that is plural-formatted "@count items" */ function _aggregator_items($count) { return format_plural($count, '1 item', '@count items'); diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc index 78ca5bc..84a0386 100644 --- a/core/modules/aggregator/aggregator.pages.inc +++ b/core/modules/aggregator/aggregator.pages.inc @@ -8,6 +8,9 @@ /** * Page callback: Displays the most recent items gathered from any feed. * + * @return string + * The rendered list of items for the feed. + * * @see aggregator_menu() */ function aggregator_page_last() { @@ -19,11 +22,14 @@ function aggregator_page_last() { } /** - * Page callback: Displays all the items captured from a particular feed. + * Page callback: Displays all the items captured from the particular feed. * * @param $feed * The feed for which to display all items. * + * @return string + * The rendered list of items for the feed. + * * @see aggregator_menu() */ function aggregator_page_source($feed) { @@ -43,8 +49,12 @@ function aggregator_page_source($feed) { * @param $feed * The feed for which to list all the aggregated items. * + * @return string + * The rendered list of items for the feed. + * * @see aggregator_menu() * @see aggregator_page_source() + * * @ingroup forms */ function aggregator_page_source_form($form, $form_state, $feed) { @@ -57,7 +67,11 @@ function aggregator_page_source_form($form, $form_state, $feed) { * @param $category * The category for which to list all the aggregated items. * + * @return string + * The rendered list of items for the feed. + * * @see aggregator_menu() + * * @ingroup forms */ function aggregator_page_category($category) { @@ -76,8 +90,12 @@ function aggregator_page_category($category) { * @param $category * The category for which to list all the aggregated items. * + * @return string + * The rendered list of items for the feed. + * * @see aggregator_menu() * @see aggregator_page_category() + * * @ingroup forms */ function aggregator_page_category_form($form, $form_state, $category) { @@ -162,7 +180,7 @@ function aggregator_load_feed_items($type, $data = NULL) { * The feed source URL. * * @return - * The rendered list of items for a feed. + * The rendered list of items for the feed. */ function _aggregator_page_list($items, $op, $feed_source = '') { if (user_access('administer news feeds') && ($op == 'categorize')) { @@ -184,13 +202,18 @@ function _aggregator_page_list($items, $op, $feed_source = '') { /** * Form constructor to build the page list form. * - * @param $items + * @param array $items * An array of the feed items. - * @param $feed_source - * The feed source URL. + * @param string $feed_source + * (optional) The feed source URL. Defaults to an empty string. + * + * @return array + * An array of FAPI elements. * - * @ingroup forms * @see aggregator_categorize_items_submit() + * @see theme_aggregator_categorize_items() + * + * @ingroup forms */ function aggregator_categorize_items($items, $feed_source = '') { $form['#submit'][] = 'aggregator_categorize_items_submit'; @@ -347,6 +370,9 @@ function template_preprocess_aggregator_item(&$variables) { /** * Page callback: Displays all the feeds used by the aggregator. * + * @return string + * An HTML formatted string. + * * @see aggregator_menu() */ function aggregator_page_sources() { @@ -374,6 +400,9 @@ function aggregator_page_sources() { /** * Page callback: Displays all the categories used by the aggregator. * + * @return string + * An HTML formatted string. + * * @see aggregator_menu() */ function aggregator_page_categories() { @@ -399,6 +428,9 @@ function aggregator_page_categories() { /** * Page callback: Generates an RSS 0.92 feed of aggregator items or categories. * + * @return string + * An HTML formatted string. + * * @see aggregator_menu() */ function aggregator_page_rss() { @@ -420,15 +452,13 @@ function aggregator_page_rss() { } /** - * Prints the RSS page for a feed. + * Prints the RSS page for the feed. * * @param $variables * An associative array containing: * - feeds: An array of the feeds to theme. * - category: A common category, if any, for all the feeds. * - * @return void - * * @ingroup themeable */ function theme_aggregator_page_rss($variables) { @@ -471,8 +501,11 @@ function theme_aggregator_page_rss($variables) { * Page callback: Generates an OPML representation of all feeds. * * @param $cid - * If set, feeds are exported only from a category with this ID. Otherwise, - * all feeds are exported. + * (optional) If set, feeds are exported only from a category with this ID. + * Otherwise, all feeds are exported. Defaults to NULL. + * + * @return string + * An HTML formatted string. * * @see aggregator_menu() */ @@ -489,14 +522,12 @@ function aggregator_page_opml($cid = NULL) { } /** - * Prints the OPML page for a feed. + * Prints the OPML page for the feed. * - * @param $variables + * @param array $variables * An associative array containing: * - feeds: An array of the feeds to theme. * - * @return void - * * @ingroup themeable */ function theme_aggregator_page_opml($variables) { diff --git a/core/modules/aggregator/aggregator.parser.inc b/core/modules/aggregator/aggregator.parser.inc index bacaa84..e1491f3 100644 --- a/core/modules/aggregator/aggregator.parser.inc +++ b/core/modules/aggregator/aggregator.parser.inc @@ -242,6 +242,7 @@ function aggregator_element_end($parser, $name) { * Performs an action when data is encountered. * * Callback function used by xml_parse() within aggregator_parse_feed(). + * */ function aggregator_element_data($parser, $data) { global $channel, $element, $items, $item, $image, $tag; diff --git a/core/modules/aggregator/aggregator.processor.inc b/core/modules/aggregator/aggregator.processor.inc index b333a96..d3f272a 100644 --- a/core/modules/aggregator/aggregator.processor.inc +++ b/core/modules/aggregator/aggregator.processor.inc @@ -133,6 +133,12 @@ function aggregator_form_aggregator_admin_form_alter(&$form, $form_state) { * * Callback for drupal_map_assoc() within * aggregator_form_aggregator_admin_form_alter(). + * + * @param int $length + * The desired length of teaser text, in bytes. + * + * @return string + * A translated string explaining the teaser string length. */ function _aggregator_characters($length) { return ($length == 0) ? t('Unlimited') : format_plural($length, '1 character', '@count characters'); diff --git a/core/modules/aggregator/aggregator.theme-rtl.css b/core/modules/aggregator/aggregator.theme-rtl.css index f02ae91..3efccd0 100644 --- a/core/modules/aggregator/aggregator.theme-rtl.css +++ b/core/modules/aggregator/aggregator.theme-rtl.css @@ -1,3 +1,7 @@ +/** + * Right-to-Left styles for theme in Aggregator module. + */ + .aggregator .feed-icon { float: left; } diff --git a/core/modules/aggregator/aggregator.theme.css b/core/modules/aggregator/aggregator.theme.css index e2182ac..7943913 100644 --- a/core/modules/aggregator/aggregator.theme.css +++ b/core/modules/aggregator/aggregator.theme.css @@ -1,3 +1,7 @@ +/** + * Styles for theme in Aggregator module. + */ + .aggregator .feed-icon { float: right; /* LTR */ display: block; diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/FetcherInterface.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/FetcherInterface.php index 39fc19d..6c79a59 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/FetcherInterface.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/FetcherInterface.php @@ -1,4 +1,5 @@ 'Add feed functionality', @@ -20,7 +21,7 @@ public static function getInfo() { } /** - * Create a feed, ensure that it is unique, check the source, and delete the feed. + * Creates and ensures that a feed is unique, checks source, and deletes feed. */ function testAddFeed() { $feed = $this->createFeed(); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php index 503b9a1..4aec917 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorConfigurationTest.php @@ -8,9 +8,10 @@ namespace Drupal\aggregator\Tests; /** - * Tests aggregator configuration settings. + * Tests the configuration settings functionality in the Aggregator module. */ class AggregatorConfigurationTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Aggregator configuration', @@ -37,4 +38,5 @@ function testSettingsPage() { $this->assertFieldByName($name, $value, format_string('"@name" has correct default value.', array('@name' => $name))); } } + } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php index 0966937..750ddd7 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests cron process functionality in Aggregator module. + */ class AggregatorCronTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Update on cron functionality', @@ -17,7 +21,7 @@ public static function getInfo() { } /** - * Add feeds update them on cron. + * Adds feeds and updates them via cron process. */ public function testCron() { // Create feed and test basic updating on cron. diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php index 7f09317..9397e93 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests rendering functionality in Aggregator module. + */ class AggregatorRenderingTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Checks display of aggregator items', @@ -17,9 +21,9 @@ public static function getInfo() { } /** - * Add a feed block to the page and checks its links. + * Adds a feed block to the page and checks its links. * - * TODO: Test the category block as well. + * @todo Test the category block as well. */ public function testBlockLinks() { // Create feed. @@ -78,7 +82,7 @@ public function testBlockLinks() { } /** - * Create a feed and check that feed's page. + * Creates a feed and checks that feed's page. */ public function testFeedPage() { // Increase the number of items published in the rss.xml feed so we have diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php index f46c2c4..340c93e 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php @@ -10,7 +10,7 @@ use Drupal\simpletest\WebTestBase; /** - * Defines a base class for testing aggregator.module. + * Defines a base class for testing the Aggregator module. */ abstract class AggregatorTestBase extends WebTestBase { @@ -34,10 +34,15 @@ function setUp() { } /** - * Create an aggregator feed (simulate form submission on admin/config/services/aggregator/add/feed). + * Creates an aggregator feed. + * + * This method simulates the form submission on path + * admin/config/services/aggregator/add/feed. * * @param $feed_url - * If given, feed will be created with this URL, otherwise /rss.xml will be used. + * (optional) If given, feed will be created with this URL, otherwise + * /rss.xml will be used. Defaults to NULL. + * * @return $feed * Full feed object if possible. * @@ -54,7 +59,7 @@ function createFeed($feed_url = NULL) { } /** - * Delete an aggregator feed. + * Deletes an aggregator feed. * * @param $feed * Feed object representing the feed. @@ -65,10 +70,12 @@ function deleteFeed($feed) { } /** - * Return a randomly generated feed edit array. + * Returns a randomly generated feed edit array. * * @param $feed_url - * If given, feed will be created with this URL, otherwise /rss.xml will be used. + * (optional) If given, feed will be created with this URL, otherwise + * /rss.xml will be used. Defaults to NULL. + * * @return * A feed array. */ @@ -89,7 +96,7 @@ function getFeedEditArray($feed_url = NULL) { } /** - * Return the count of the randomly created feed array. + * Returns the count of the randomly created feed array. * * @return * Number of feed items on default feed created by createFeed(). @@ -101,10 +108,13 @@ function getDefaultFeedItemCount() { } /** - * Update feed items (simulate click to admin/config/services/aggregator/update/$fid). + * Updates the feed items. + * + * This method simulates a click to + * admin/config/services/aggregator/update/$fid. * * @param $feed - * Feed object representing the feed. + * Feed object representing the feed, passed by reference. * @param $expected_count * Expected number of feed items. */ @@ -133,7 +143,7 @@ function updateFeedItems(&$feed, $expected_count) { } /** - * Confirm item removal from a feed. + * Confirms an item removal from a feed. * * @param $feed * Feed object representing the feed. @@ -144,7 +154,7 @@ function removeFeedItems($feed) { } /** - * Add and remove feed items and ensure that the count is zero. + * Adds and removes feed items and ensure that the count is zero. * * @param $feed * Feed object representing the feed. @@ -161,7 +171,7 @@ function updateAndRemove($feed, $expected_count) { } /** - * Pull feed categories from aggregator_category_feed table. + * Pulls feed categories from {aggregator_category_feed} table. * * @param $feed * Feed object representing the feed. @@ -175,7 +185,11 @@ function getFeedCategories($feed) { } /** - * Pull categories from aggregator_category table. + * Pulls categories from aggregator_category table. + * + * @return array + * An associative array keyed by category ID and values of the category + * name. */ function getCategories() { $categories = array(); @@ -188,12 +202,13 @@ function getCategories() { /** - * Check if the feed name and url is unique. + * Checks if the feed name and url is unique. * * @param $feed_name * String containing the feed name to check. * @param $feed_url * String containing the feed url to check. + * * @return * TRUE if feed is unique. */ @@ -203,10 +218,11 @@ function uniqueFeed($feed_name, $feed_url) { } /** - * Create a valid OPML file from an array of feeds. + * Creates a valid OPML file from an array of feeds. * * @param $feeds * An array of feeds. + * * @return * Path to valid OPML file. */ @@ -244,7 +260,7 @@ function getValidOpml($feeds) { } /** - * Create an invalid OPML file. + * Creates an invalid OPML file. * * @return * Path to invalid OPML file. @@ -261,7 +277,7 @@ function getInvalidOpml() { } /** - * Create a valid but empty OPML file. + * Creates a valid but empty OPML file. * * @return * Path to empty OPML file. @@ -300,7 +316,7 @@ function getHtmlEntitiesSample() { * Creates sample article nodes. * * @param $count - * (optional) The number of nodes to generate. + * (optional) The number of nodes to generate. Defaults to five. */ function createSampleNodes($count = 5) { $langcode = LANGUAGE_NOT_SPECIFIED; diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php index ae71799..371b28b 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests categorization functionality in Aggregator module. + */ class CategorizeFeedItemTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Categorize feed item functionality', @@ -17,6 +21,8 @@ public static function getInfo() { } /** + * Checks that children of a feed inherit a defined category. + * * If a feed has a category, make sure that the children inherit that * categorization. */ diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php index 977dbcb..c6f0b23 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests categorize feed functionality in Aggregator module. + */ class CategorizeFeedTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Categorize feed functionality', @@ -17,7 +21,7 @@ public static function getInfo() { } /** - * Create a feed and make sure you can add more than one category to it. + * Creates a feed and makes sure you can add more than one category to it. */ function testCategorizeFeed() { diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php index 907bc3a..66c38e8 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php @@ -8,9 +8,10 @@ namespace Drupal\aggregator\Tests; /** - * Tests for feed parsing. + * Tests for feed parsing in the Aggregator module. */ class FeedParserTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Feed parser functionality', @@ -28,7 +29,7 @@ function setUp() { } /** - * Test a feed that uses the RSS 0.91 format. + * Tests a feed that uses the RSS 0.91 format. */ function testRSS091Sample() { $feed = $this->createFeed($this->getRSS091Sample()); @@ -50,7 +51,7 @@ function testRSS091Sample() { } /** - * Test a feed that uses the Atom format. + * Tests a feed that uses the Atom format. */ function testAtomSample() { $feed = $this->createFeed($this->getAtomSample()); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php index 0e2f1e9..5ec0cf0 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/ImportOpmlTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests importing feeds from OPML functionality for Aggregator module. + */ class ImportOpmlTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Import feeds from OPML functionality', @@ -17,7 +21,7 @@ public static function getInfo() { } /** - * Open OPML import form. + * Opens OPML import form. */ function openImportForm() { db_delete('aggregator_category')->execute(); @@ -39,7 +43,7 @@ function openImportForm() { } /** - * Submit form filled with invalid fields. + * Submits form filled with invalid fields. */ function validateImportFormFields() { $before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField(); @@ -65,7 +69,7 @@ function validateImportFormFields() { } /** - * Submit form with invalid, empty and valid OPML files. + * Submits form with invalid, empty and valid OPML files. */ function submitImportForm() { $before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField(); @@ -124,6 +128,9 @@ function submitImportForm() { $this->assertTrue($category, 'Categories are correct.'); } + /** + * Tests the import of an OPML feed. + */ function testOpmlImport() { $this->openImportForm(); $this->validateImportFormFields(); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php index 32433ae..092a098 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests removing a feed item functionality in the Aggregator module. + */ class RemoveFeedItemTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Remove feed item functionality', @@ -17,7 +21,7 @@ public static function getInfo() { } /** - * Test running "remove items" from the 'admin/config/services/aggregator' page. + * Tests running "remove items" from 'admin/config/services/aggregator' page. */ function testRemoveFeedItem() { // Create a bunch of test feeds. diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedTest.php index 983ec57..8932e67 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Test the removal of a feed functionality in the Aggregator module. + */ class RemoveFeedTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Remove feed functionality', @@ -17,7 +21,7 @@ public static function getInfo() { } /** - * Remove a feed and ensure that all it services are removed. + * Removes a feed and ensures that all of its services are removed. */ function testRemoveFeed() { $feed = $this->createFeed(); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php index bf1d2be..3115725 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests updating a feed item functionality in the Aggregator module. + */ class UpdateFeedItemTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Update feed item functionality', @@ -17,7 +21,7 @@ public static function getInfo() { } /** - * Test running "update items" from the 'admin/config/services/aggregator' page. + * Tests running "update items" from 'admin/config/services/aggregator' page. */ function testUpdateFeedItem() { $this->createSampleNodes(); @@ -65,4 +69,5 @@ function testUpdateFeedItem() { $after = db_query('SELECT timestamp FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->fid))->fetchField(); $this->assertTrue($before === $after, format_string('Publish timestamp of feed item was not updated (!before === !after)', array('!before' => $before, '!after' => $after))); } + } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php index fd8a828..9fc512c 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php @@ -7,7 +7,11 @@ namespace Drupal\aggregator\Tests; +/** + * Tests updating the feed functionality in the Aggregator module. + */ class UpdateFeedTest extends AggregatorTestBase { + public static function getInfo() { return array( 'name' => 'Update feed functionality', @@ -17,7 +21,7 @@ public static function getInfo() { } /** - * Create a feed and attempt to update it. + * Creates a feed and attempts to update it. */ function testUpdateFeed() { $remamining_fields = array('title', 'url', ''); @@ -47,4 +51,5 @@ function testUpdateFeed() { $this->deleteFeed($feed); } } + } -- 1.7.6.msysgit.0