You are here

public function AggregatorTestBase::getDefaultFeedItemCount in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/aggregator/src/Tests/AggregatorTestBase.php \Drupal\aggregator\Tests\AggregatorTestBase::getDefaultFeedItemCount()

Returns the count of the randomly created feed array.

Return value

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

2 calls to AggregatorTestBase::getDefaultFeedItemCount()
AggregatorRenderingTest::testBlockLinks in core/modules/aggregator/src/Tests/AggregatorRenderingTest.php
Adds a feed block to the page and checks its links.
UpdateFeedItemTest::testUpdateFeedItem in core/modules/aggregator/src/Tests/UpdateFeedItemTest.php
Tests running "update items" from 'admin/config/services/aggregator' page.

File

core/modules/aggregator/src/Tests/AggregatorTestBase.php, line 149
Contains \Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

public 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(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, $this
    ->config('system.rss')
    ->get('items.limit'))
    ->fetchField();
  return $feed_count > 10 ? 10 : $feed_count;
}