Creates and ensures that a feed is unique, checks source, and deletes feed.

File

modules/aggregator/aggregator.test, line 364
Tests for aggregator.module.

Class

AddFeedTestCase
Tests adding aggregator feeds.

Code

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

  // Check feed data.
  $this
    ->assertEqual($this
    ->getUrl(), url('admin/config/services/aggregator/add/feed', array(
    'absolute' => TRUE,
  )), 'Directed to correct url.');
  $this
    ->assertTrue($this
    ->uniqueFeed($feed->title, $feed->url), 'The feed is unique.');

  // Check feed source.
  $this
    ->drupalGet('aggregator/sources/' . $feed->fid);
  $this
    ->assertResponse(200, 'Feed source exists.');
  $this
    ->assertText($feed->title, 'Page title');
  $this
    ->drupalGet('aggregator/sources/' . $feed->fid . '/categorize');
  $this
    ->assertResponse(200, 'Feed categorization page exists.');

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