summaryrefslogtreecommitdiff
path: root/modules/aggregator/aggregator.test
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-10-09 07:45:30 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-10-09 07:45:30 -0700
commit8ab4dbc3cb32864cce9d1ae6427a864e14f45f00 (patch)
treeab6b53ec6da6f250c2203492ad3c5a78fa8df8b8 /modules/aggregator/aggregator.test
parentfe1461efbc13027c73265554720135203ee1871a (diff)
downloadbrdo-8ab4dbc3cb32864cce9d1ae6427a864e14f45f00.tar.gz
brdo-8ab4dbc3cb32864cce9d1ae6427a864e14f45f00.tar.bz2
Issue #743234 by mr.baileys, twistor, Berdir, mgifford: Fixed /aggregator does not use pagination.
Diffstat (limited to 'modules/aggregator/aggregator.test')
-rw-r--r--modules/aggregator/aggregator.test34
1 files changed, 31 insertions, 3 deletions
diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test
index 1ab12dc2e..0d1e31ba5 100644
--- a/modules/aggregator/aggregator.test
+++ b/modules/aggregator/aggregator.test
@@ -266,10 +266,16 @@ EOF;
return $GLOBALS['base_url'] . '/' . drupal_get_path('module', 'aggregator') . '/tests/aggregator_test_atom.xml';
}
- function createSampleNodes() {
+ /**
+ * Creates sample article nodes.
+ *
+ * @param $count
+ * (optional) The number of nodes to generate.
+ */
+ function createSampleNodes($count = 5) {
$langcode = LANGUAGE_NONE;
- // Post 5 articles.
- for ($i = 0; $i < 5; $i++) {
+ // Post $count article nodes.
+ for ($i = 0; $i < $count; $i++) {
$edit = array();
$edit['title'] = $this->randomName();
$edit["body[$langcode][0][value]"] = $this->randomName();
@@ -807,6 +813,28 @@ class AggregatorRenderingTestCase extends AggregatorTestCase {
$correct_titles = $this->xpath('//h1[normalize-space(text())=:title]', array(':title' => $feed->title));
$this->assertFalse(empty($correct_titles), t('Aggregator feed page is available and has the correct title.'));
}
+
+ /**
+ * Create a feed and check that feed's page.
+ */
+ public function testFeedPage() {
+ // Increase the number of items published in the rss.xml feed so we have
+ // enough articles to test paging.
+ variable_set('feed_default_items', 30);
+
+ // Create a feed with 30 items.
+ $this->createSampleNodes(30);
+ $feed = $this->createFeed();
+ $this->updateFeedItems($feed, 30);
+
+ // Check for the presence of a pager.
+ $this->drupalGet('aggregator/sources/' . $feed->fid);
+ $elements = $this->xpath("//ul[@class=:class]", array(':class' => 'pager'));
+ $this->assertTrue(!empty($elements), t('Individual source page contains a pager.'));
+
+ // Reset the number of items in rss.xml to the default value.
+ variable_set('feed_default_items', 10);
+ }
}
/**