function AggregatorTestBase::uniqueFeed

Check if the feed name and url is unique.

Parameters

$feed_name: String containing the feed name to check.

$feed_url: String containing the feed url to check.

Return value

TRUE if feed is unique.

3 calls to AggregatorTestBase::uniqueFeed()
AddFeedTest::testAddFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AddFeedTest.php
Create a feed, ensure that it is unique, check the source, and delete the feed.
AddFeedTest::testAddLongFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AddFeedTest.php
Tests feeds with very long URLs.
UpdateFeedTest::testUpdateFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/UpdateFeedTest.php
Create a feed and attempt to update it.

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php, line 200
Definition of Drupal\aggregator\Tests\AggregatorTestBase.

Class

AggregatorTestBase
Defines a base class for testing aggregator.module.

Namespace

Drupal\aggregator\Tests

Code

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