Author: as Date: Tue Nov 20 12:28:33 2007 New Revision: 6771 Log: - Added some tests for podcasts.
Added: trunk/Feed/tests/rss2/data/librivox_podcast.xml trunk/Feed/tests/rss2/data/woodsongs_old_time_radio_hour.xml Modified: trunk/Feed/tests/feed_test.php Modified: trunk/Feed/tests/feed_test.php ============================================================================== --- trunk/Feed/tests/feed_test.php [iso-8859-1] (original) +++ trunk/Feed/tests/feed_test.php [iso-8859-1] Tue Nov 20 12:28:33 2007 @@ -136,5 +136,57 @@ $this->assertEquals( $expected, $result ); } } + + public function testParseAtom() + { + $dot = DIRECTORY_SEPARATOR; + $file = dirname( __FILE__ ) . "{$dot}atom{$dot}data{$dot}atom_example_from_specs.xml"; + + $feed = ezcFeed::parse( $file ); + + $this->assertEquals( 'atom', $feed->getFeedType() ); + } + + public function testParseRss1() + { + $dot = DIRECTORY_SEPARATOR; + $file = dirname( __FILE__ ) . "{$dot}rss1{$dot}data{$dot}rss1_example_from_specs.xml"; + + $feed = ezcFeed::parse( $file ); + + $this->assertEquals( 'rss1', $feed->getFeedType() ); + } + + public function testParseRss2() + { + $dot = DIRECTORY_SEPARATOR; + $file = dirname( __FILE__ ) . "{$dot}rss2{$dot}data{$dot}rss2_example_from_specs.xml"; + + $feed = ezcFeed::parse( $file ); + + $this->assertEquals( 'rss2', $feed->getFeedType() ); + } + + public function testParseRss2Podcast1() + { + $dot = DIRECTORY_SEPARATOR; + $file = dirname( __FILE__ ) . "{$dot}rss2{$dot}data{$dot}librivox_podcast.xml"; + + $feed = ezcFeed::parse( $file ); + + $this->assertEquals( 'rss2', $feed->getFeedType() ); + $this->assertEquals( 'LibriVox Audiobooks', $feed->title->__toString() ); + } + + public function testParseRss2Podcast2() + { + $dot = DIRECTORY_SEPARATOR; + $file = dirname( __FILE__ ) . "{$dot}rss2{$dot}data{$dot}woodsongs_old_time_radio_hour.xml"; + + $feed = ezcFeed::parse( $file ); + + $this->assertEquals( 'rss2', $feed->getFeedType() ); + $this->assertEquals( 'The Woodsongs Old Time Radio Hour Podcast', $feed->title->__toString() ); + } } ?> -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components