FeedParserTestCase::testAtomSample

7 aggregator.test FeedParserTestCase::testAtomSample()
8 aggregator.test FeedParserTestCase::testAtomSample()

Test a feed that uses the Atom format.

File

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

Code

function testAtomSample() {
  $feed = $this->createFeed($this->getAtomSample());
  aggregator_refresh($feed);
  $this->drupalGet('aggregator/sources/' . $feed->fid);
  $this->assertResponse(200, t('Feed %name exists.', array('%name' => $feed->title)));
  $this->assertText('Atom-Powered Robots Run Amok');
  $this->assertLinkByHref('http://example.org/2003/12/13/atom03');
  $this->assertText('Some text.');
  $this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', array(':link' => 'http://example.org/2003/12/13/atom03'))->fetchField(), 'Atom entry id element is parsed correctly.');
}
Login or register to post comments