You are here

public function FeedParserTest::testRSS091Sample in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/aggregator/src/Tests/FeedParserTest.php \Drupal\aggregator\Tests\FeedParserTest::testRSS091Sample()

Tests a feed that uses the RSS 0.91 format.

File

core/modules/aggregator/src/Tests/FeedParserTest.php, line 33
Contains \Drupal\aggregator\Tests\FeedParserTest.

Class

FeedParserTest
Tests the built-in feed parser with valid feed samples.

Namespace

Drupal\aggregator\Tests

Code

public function testRSS091Sample() {
  $feed = $this
    ->createFeed($this
    ->getRSS091Sample());
  $feed
    ->refreshItems();
  $this
    ->drupalGet('aggregator/sources/' . $feed
    ->id());
  $this
    ->assertResponse(200, format_string('Feed %name exists.', array(
    '%name' => $feed
      ->label(),
  )));
  $this
    ->assertText('First example feed item title');
  $this
    ->assertLinkByHref('http://example.com/example-turns-one');
  $this
    ->assertText('First example feed item description.');
  $this
    ->assertRaw('<img src="http://example.com/images/druplicon.png"');

  // Several additional items that include elements over 255 characters.
  $this
    ->assertRaw("Second example feed item title.");
  $this
    ->assertText('Long link feed item title');
  $this
    ->assertText('Long link feed item description');
  $this
    ->assertLinkByHref('http://example.com/tomorrow/and/tomorrow/and/tomorrow/creeps/in/this/petty/pace/from/day/to/day/to/the/last/syllable/of/recorded/time/and/all/our/yesterdays/have/lighted/fools/the/way/to/dusty/death/out/out/brief/candle/life/is/but/a/walking/shadow/a/poor/player/that/struts/and/frets/his/hour/upon/the/stage/and/is/heard/no/more/it/is/a/tale/told/by/an/idiot/full/of/sound/and/fury/signifying/nothing');
  $this
    ->assertText('Long author feed item title');
  $this
    ->assertText('Long author feed item description');
  $this
    ->assertLinkByHref('http://example.com/long/author');
}