function RemoveFeedTestCase::testRemoveFeed

7.x aggregator.test RemoveFeedTestCase::testRemoveFeed()

Removes a feed and ensures that all of its services are removed.

File

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

Class

RemoveFeedTestCase
Tests functionality for removing feeds in the Aggregator module.

Code

function testRemoveFeed() {
  $feed = $this->createFeed();

  // Delete feed.
  $this->deleteFeed($feed);

  // Check feed source.
  $this->drupalGet('aggregator/sources/' . $feed->fid);
  $this->assertResponse(404, 'Deleted feed source does not exists.');

  // Check database for feed.
  $result = db_query("SELECT COUNT(*) FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $feed->title, ':url' => $feed->url))->fetchField();
  $this->assertFalse($result, 'Feed not found in database');
}