AggregatorTestCase::getDefaultFeedItemCount

  1. drupal
    1. 8
    2. 7
Versions
7 AggregatorTestCase::getDefaultFeedItemCount()

Return the count of the randomly created feed array.

Return value

Number of feed items on default feed created by createFeed().

Code

modules/aggregator/aggregator.test, line 76

<?php
function getDefaultFeedItemCount() {
  // Our tests are based off of rss.xml, so let's find out how many elements should be related.
  $feed_count = db_query_range('SELECT COUNT(*) FROM {node} n WHERE n.promote = 1 AND n.status = 1', 0, variable_get('feed_default_items', 10))->fetchField();
  return $feed_count > 10 ? 10 : $feed_count;
}
?>