You are here

public function AggregatorTestBase::getDefaultFeedItemCount in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php \Drupal\Tests\aggregator\Functional\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/tests/src/Functional/AggregatorRenderingTest.php
Adds a feed block to the page and checks its links.
UpdateFeedItemTest::testUpdateFeedItem in core/modules/aggregator/tests/src/Functional/UpdateFeedItemTest.php
Tests running "update items" from 'admin/config/services/aggregator' page.

File

core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php, line 167

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\Tests\aggregator\Functional

Code

public function getDefaultFeedItemCount() {

  // Our tests are based off of rss.xml, so let's find out how many elements
  // should be related.
  return \Drupal::entityQuery('node')
    ->condition('promote', NodeInterface::PROMOTED)
    ->condition('status', NodeInterface::PUBLISHED)
    ->accessCheck(FALSE)
    ->range(0, 10)
    ->count()
    ->execute();
}