function AggregatorTestBase::getDefaultFeedItemCount

Return the count of the randomly created feed array.

Return value

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

3 calls to AggregatorTestBase::getDefaultFeedItemCount()

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php, line 97
Definition of Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing aggregator.module.

Namespace

Drupal\aggregator\Tests

Code

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, config('system.rss')
    ->get('items.limit'))
    ->fetchField();
  return $feed_count > 10 ? 10 : $feed_count;
}