You are here

function AggregatorTestCase::updateAndRemove in Drupal 7

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
Tests for aggregator.module.

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