function RemoveFeedItemTestCase::testRemoveFeedItem

7.x aggregator.test RemoveFeedItemTestCase::testRemoveFeedItem()

Tests running "remove items" from 'admin/config/services/aggregator' page.

File

drupal-7.x/modules/aggregator/aggregator.test, line 601
Tests for aggregator.module.

Class

RemoveFeedItemTestCase

Code

function testRemoveFeedItem() {
  // Create a bunch of test feeds.
  $feed_urls = array();
  // No last-modified, no etag.
  $feed_urls[] = url('aggregator/test-feed', array('absolute' => TRUE));
  // Last-modified, but no etag.
  $feed_urls[] = url('aggregator/test-feed/1', array('absolute' => TRUE));
  // No Last-modified, but etag.
  $feed_urls[] = url('aggregator/test-feed/0/1', array('absolute' => TRUE));
  // Last-modified and etag.
  $feed_urls[] = url('aggregator/test-feed/1/1', array('absolute' => TRUE));

  foreach ($feed_urls as $feed_url) {
    $feed = $this->createFeed($feed_url);
    // Update and remove items two times in a row to make sure that removal
    // resets all 'modified' information (modified, etag, hash) and allows for
    // immediate update.
    $this->updateAndRemove($feed, 4);
    $this->updateAndRemove($feed, 4);
    $this->updateAndRemove($feed, 4);
    // Delete feed.
    $this->deleteFeed($feed);
  }
}