public function AggregatorTestBase::uniqueFeed in Drupal 8
Same name in this branch
- 8 core/modules/aggregator/src/Tests/AggregatorTestBase.php \Drupal\aggregator\Tests\AggregatorTestBase::uniqueFeed()
- 8 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.
File
- core/
modules/ aggregator/ src/ Tests/ AggregatorTestBase.php, line 254
Class
- AggregatorTestBase
- Defines a base class for testing the Aggregator module.
Namespace
Drupal\aggregator\TestsCode
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;
}