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()
AggregatorRenderingTest::testBlockLinks in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorRenderingTest.php
Add a feed block to the page and checks its links.
CategorizeFeedItemTest::testCategorizeFeedItem in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php
If a feed has a category, make sure that the children inherit that categorization.
UpdateFeedItemTest::testUpdateFeedItem in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedItemTest.php
Test running "update items" from the 'admin/config/services/aggregator' page.

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;
}