function FeedParserTestCase::testAtomSample

Tests a feed that uses the Atom format.

File

drupal/modules/aggregator/aggregator.test, line 1049
Tests for aggregator.module.

Class

FeedParserTestCase
Tests feed parsing in the Aggregator module.

Code

function testAtomSample() {
  $feed = $this
    ->createFeed($this
    ->getAtomSample());
  aggregator_refresh($feed);
  $this
    ->drupalGet('aggregator/sources/' . $feed->fid);
  $this
    ->assertResponse(200, format_string('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.');
}