function AggregatorTestCase::updateAndRemove
Adds and removes feed items and ensure that the count is zero.
Parameters
$feed: Feed object representing the feed.
$expected_count: Expected number of feed items.
1 call to AggregatorTestCase::updateAndRemove()
- RemoveFeedItemTestCase::testRemoveFeedItem in modules/
aggregator/ aggregator.test - Tests running "remove items" from 'admin/config/services/aggregator' page.
File
-
modules/
aggregator/ aggregator.test, line 145
Class
- AggregatorTestCase
- Defines a base class for testing the Aggregator module.
Code
function updateAndRemove($feed, $expected_count) {
$this->updateFeedItems($feed, $expected_count);
$count = db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', array(
':fid' => $feed->fid,
))
->fetchField();
$this->assertTrue($count);
$this->removeFeedItems($feed);
$count = db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', array(
':fid' => $feed->fid,
))
->fetchField();
$this->assertTrue($count == 0);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.