You are here

protected function CommonSyndicationParserTestCase::_testAtomGeoRSS in Feeds 6

Same name and namespace in other branches
  1. 7.2 tests/common_syndication_parser.test \CommonSyndicationParserTestCase::_testAtomGeoRSS()
  2. 7 tests/common_syndication_parser.test \CommonSyndicationParserTestCase::_testAtomGeoRSS()

Test Geo RSS in Atom feed.

1 call to CommonSyndicationParserTestCase::_testAtomGeoRSS()
CommonSyndicationParserTestCase::test in tests/common_syndication_parser.test
Dispatch tests, only use one entry point method testX to save time.

File

tests/common_syndication_parser.test, line 64

Class

CommonSyndicationParserTestCase
Test cases for common syndication parser library.

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');
}