AddFeedTestCase::testAddFeed

7 aggregator.test AddFeedTestCase::testAddFeed()
8 aggregator.test AddFeedTestCase::testAddFeed()

Create a feed, ensure that it is unique, check the source, and delete the feed.

File

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

Code

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

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

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

  // Delete feed.
  $this->deleteFeed($feed);
}
Login or register to post comments