This is a fake feed 2010-05-15T01:00:00Z http://www.phpwiki.org/fakeurl Cool feed Sébastien Le Callonnec slc_ie@yahoo.ie Foobar Éire
Millenium Spire, Dublin
Geo coordinates: 53.349441 -6.260282
2010-05-15T01:00:00Z 2010-05-15T01:00:00Z 53.349441 -6.26234 53.35078 -6.260282 tag:www.phpwiki.org,2010-05-15:/fakeurl/20100515223621
ATOM; $parser = new AtomParser(); $parser->parse($fake_atom_file); $this->assertFalse(count($parser->feed) == 0); $current_feed = $parser->feed[0]; $this->assertEquals("This is a fake feed", $current_feed["title"]); $this->assertFalse(count($current_feed["links"]) == 0); $this->assertEquals("http://www.phpwiki.org/fakeurl", $current_feed["links"][0]["href"]); $this->assertEquals("Cool feed", $current_feed["subtitle"]); $this->assertEquals("2010-05-15T01:00:00Z", $current_feed["updated"]); $this->assertFalse(count($current_feed["authors"]) == 0); $current_author = $current_feed["authors"][0]; $this->assertEquals("Sébastien Le Callonnec", $current_author["name"]); $this->assertEquals("slc_ie@yahoo.ie", $current_author["email"]); $this->assertFalse(count($parser->entries) == 0); $current_entry = $parser->entries[0]; $this->assertEquals("Foobar Éire", $current_entry["title"]); $this->assertEquals("http://maps.google.com/maps?f=q&sll=53.125728,-6.068907&ie=UTF8", $current_entry["links"][0]["href"]); $this->assertEquals("2010-05-15T01:00:00Z", $current_entry["updated"]); $this->assertEquals("2010-05-15T01:00:00Z", $current_entry["published"]); $this->assertEquals("tag:www.phpwiki.org,2010-05-15:/fakeurl/20100515223621", $current_entry["id"]); $payload =<<Millenium Spire, Dublin
Geo coordinates: 53.349441 -6.260282
CONTENT; $this->assertEquals($payload, $current_entry["content"]); } function testExtensiveAtomExampleFromRFC4287() { $fake_atom_file = << dive into mark A <em>lot</em> of effort went into making this effortless 2005-07-31T12:29:29Z tag:example.org,2003:3 Copyright (c) 2003, Mark Pilgrim Example Toolkit Atom draft-07 snapshot tag:example.org,2003:3.2397 2005-07-31T12:29:29Z 2003-12-13T08:29:29-04:00 Mark Pilgrim http://example.org/ f8dy@example.com Sam Ruby Joe Gregorio

[Update: The Atom draft is finished.]

ATOM; $parser = new AtomParser(); $parser->parse($fake_atom_file); $this->assertFalse(count($parser->feed) == 0); $current_feed = $parser->feed[0]; $this->assertEquals("dive into mark", $current_feed["title"]); $this->assertEquals("Copyright (c) 2003, Mark Pilgrim", $current_feed["rights"]); $this->assertEquals("A lot of effort\n went into making this effortless", $current_feed["subtitle"]); $this->assertEquals("2005-07-31T12:29:29Z", $current_feed["updated"]); $this->assertEquals("tag:example.org,2003:3", $current_feed["id"]); $this->assertEquals("Example Toolkit", $current_feed["generator"]); $this->assertTrue(count($current_feed["authors"]) == 0); $this->assertTrue(count($current_feed["contributors"]) == 0); $this->assertFalse(count($parser->entries) == 0); $current_entry = $parser->entries[0]; $this->assertEquals("Atom draft-07 snapshot", $current_entry["title"]); $this->assertEquals("2005-07-31T12:29:29Z", $current_entry["updated"]); $this->assertEquals("2003-12-13T08:29:29-04:00", $current_entry["published"]); $this->assertEquals("tag:example.org,2003:3.2397", $current_entry["id"]); $this->assertEquals(2, count($current_entry["links"])); $this->assertTrue(count($current_entry["authors"]) == 1); $this->assertTrue(count($current_entry["contributors"]) == 2); $current_author = $current_entry["authors"][0]; $this->assertEquals("Mark Pilgrim", $current_author["name"]); $this->assertEquals("f8dy@example.com", $current_author["email"]); $first_contributor = $current_entry["contributors"][0]; $second_contributor = $current_entry["contributors"][1]; $this->assertEquals("Sam Ruby", $first_contributor["name"]); $this->assertEquals("Joe Gregorio", $second_contributor["name"]); $first_link = $current_entry["links"][0]; $this->assertEquals("alternate", $first_link["rel"]); $this->assertEquals("text/html", $first_link["type"]); $this->assertEquals("http://example.org/2005/04/02/atom", $first_link["href"]); $second_link = $current_entry["links"][1]; $this->assertEquals("enclosure", $second_link["rel"]); $this->assertEquals("audio/mpeg", $second_link["type"]); $this->assertEquals("1337", $second_link["length"]); $this->assertEquals("http://example.org/audio/ph34r_my_podcast.mp3", $second_link["href"]); $payload = <<

[Update: The Atom draft is finished.]

CONTENT; $this->assertEquals($payload, $current_entry["content"]); } } ?>