You are here

public function AggregatorTestBase::uniqueFeed in Drupal 8

Same name in this branch
  1. 8 core/modules/aggregator/src/Tests/AggregatorTestBase.php \Drupal\aggregator\Tests\AggregatorTestBase::uniqueFeed()
  2. 8 core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php \Drupal\Tests\aggregator\Functional\AggregatorTestBase::uniqueFeed()
Same name and namespace in other branches
  1. 9 core/modules/aggregator/tests/src/Functional/AggregatorTestBase.php \Drupal\Tests\aggregator\Functional\AggregatorTestBase::uniqueFeed()

Checks whether the feed name and URL are unique.

Parameters

string $feed_name: String containing the feed name to check.

string $feed_url: String containing the feed url to check.

Return value

bool TRUE if feed is unique.

3 calls to AggregatorTestBase::uniqueFeed()
AddFeedTest::testAddFeed in core/modules/aggregator/tests/src/Functional/AddFeedTest.php
Creates and ensures that a feed is unique, checks source, and deletes feed.
AddFeedTest::testAddLongFeed in core/modules/aggregator/tests/src/Functional/AddFeedTest.php
Tests feeds with very long URLs.
UpdateFeedTest::testUpdateFeed in core/modules/aggregator/tests/src/Functional/UpdateFeedTest.php
Creates a feed and attempts to update it.

File

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

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\Tests\aggregator\Functional

Code

public function uniqueFeed($feed_name, $feed_url) {
  $result = \Drupal::entityQuery('aggregator_feed')
    ->condition('title', $feed_name)
    ->condition('url', $feed_url)
    ->count()
    ->execute();
  return 1 == $result;
}