8.3.x AggregatorTestBase.php public AggregatorTestBase::uniqueFeed($feed_name, $feed_url)
8.3.x AggregatorTestBase.php public AggregatorTestBase::uniqueFeed($feed_name, $feed_url)
8.0.x AggregatorTestBase.php public AggregatorTestBase::uniqueFeed($feed_name, $feed_url)
8.1.x AggregatorTestBase.php public AggregatorTestBase::uniqueFeed($feed_name, $feed_url)
8.2.x AggregatorTestBase.php public AggregatorTestBase::uniqueFeed($feed_name, $feed_url)
8.4.x AggregatorTestBase.php public AggregatorTestBase::uniqueFeed($feed_name, $feed_url)
8.4.x AggregatorTestBase.php public AggregatorTestBase::uniqueFeed($feed_name, $feed_url)

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/src/Tests/AddFeedTest.php
Creates and ensures that a feed is unique, checks source, and deletes feed.
AddFeedTest::testAddLongFeed in core/modules/aggregator/src/Tests/AddFeedTest.php
Tests feeds with very long URLs.
UpdateFeedTest::testUpdateFeed in core/modules/aggregator/src/Tests/UpdateFeedTest.php
Creates a feed and attempts to update it.

File

core/modules/aggregator/src/Tests/AggregatorTestBase.php, line 230

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

public function uniqueFeed($feed_name, $feed_url) {
  $result = db_query("SELECT COUNT(*) FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $feed_name, ':url' => $feed_url))->fetchField();
  return (1 == $result);
}