function AggregatorTestBase::getFeedCategories

Pulls feed categories from {aggregator_category_feed} table.

Parameters

\Drupal\aggregator\Plugin\Core\Entity\Feed $feed: Feed object representing the feed.

1 call to AggregatorTestBase::getFeedCategories()
CategorizeFeedItemTest::testCategorizeFeedItem in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedItemTest.php
Checks that children of a feed inherit a defined category.

File

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

Class

AggregatorTestBase
Defines a base class for testing the Aggregator module.

Namespace

Drupal\aggregator\Tests

Code

function getFeedCategories(Feed $feed) {

  // add the categories to the feed so we can use them
  $result = db_query('SELECT cid FROM {aggregator_category_feed} WHERE fid = :fid', array(
    ':fid' => $feed
      ->id(),
  ));
  foreach ($result as $category) {
    $feed->categories[] = $category->cid;
  }
}