You are here

protected function CommonSyndicationParserTest::_testAtomGeoRSS in Feeds 8.2

Test Geo RSS in Atom feed.

1 call to CommonSyndicationParserTest::_testAtomGeoRSS()
CommonSyndicationParserTest::test in lib/Drupal/feeds/Tests/CommonSyndicationParserTest.php
Dispatch tests, only use one entry point method testX to save time.

File

lib/Drupal/feeds/Tests/CommonSyndicationParserTest.php, line 71
Tests for the common syndication parser.

Class

CommonSyndicationParserTest
Test cases for common syndication parser library.

Namespace

Drupal\feeds\Tests

Code

protected function _testAtomGeoRSS() {
  $string = $this
    ->readFeed('earthquake-georss.atom');
  $feed = common_syndication_parser_parse($string);
  $this
    ->assertEqual($feed['title'], 'USGS M2.5+ Earthquakes');
  $this
    ->assertEqual($feed['items'][0]['title'], 'M 2.6, Central Alaska');
  $this
    ->assertEqual($feed['items'][1]['url'], 'http://earthquake.usgs.gov/earthquakes/recenteqsww/Quakes/us2010axbz.php');
  $this
    ->assertEqual($feed['items'][1]['guid'], 'urn:earthquake-usgs-gov:us:2010axbz');
  $this
    ->assertEqual($feed['items'][2]['guid'], 'urn:earthquake-usgs-gov:us:2010axbr');
  $this
    ->assertEqual($feed['items'][2]['geolocations'][0]['name'], '-53.1979 -118.0676');
  $this
    ->assertEqual($feed['items'][2]['geolocations'][0]['lat'], '-53.1979');
  $this
    ->assertEqual($feed['items'][2]['geolocations'][0]['lon'], '-118.0676');
  $this
    ->assertEqual($feed['items'][3]['geolocations'][0]['name'], '-43.4371 172.5902');
  $this
    ->assertEqual($feed['items'][3]['geolocations'][0]['lat'], '-43.4371');
  $this
    ->assertEqual($feed['items'][3]['geolocations'][0]['lon'], '172.5902');
}