Author: as Date: Tue Nov 20 10:11:04 2007 New Revision: 6768 Log: - Added the getFeedType() method to ezcFeed.
Modified: trunk/Feed/src/feed.php trunk/Feed/tests/feed_test.php Modified: trunk/Feed/src/feed.php ============================================================================== --- trunk/Feed/src/feed.php [iso-8859-1] (original) +++ trunk/Feed/src/feed.php [iso-8859-1] Tue Nov 20 10:11:04 2007 @@ -379,5 +379,15 @@ { return array_keys( self::$supportedFeedTypes ); } + + /** + * Returns the feed type of this feed object (eg. 'rss2'). + * + * @return string + */ + public function getFeedType() + { + return $this->feedType; + } } ?> 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 10:11:04 2007 @@ -28,10 +28,25 @@ $this->assertEquals( $expected, $types ); } - public function testCreateFeedSupported() + public function testCreateFeedSupportedRss1() { $feed = new ezcFeed( 'rss1' ); $this->assertEquals( 'ezcFeed', get_class( $feed ) ); + $this->assertEquals( 'rss1', $feed->getFeedType() ); + } + + public function testCreateFeedSupportedRss2() + { + $feed = new ezcFeed( 'rss2' ); + $this->assertEquals( 'ezcFeed', get_class( $feed ) ); + $this->assertEquals( 'rss2', $feed->getFeedType() ); + } + + public function testCreateFeedSupportedAtom() + { + $feed = new ezcFeed( 'atom' ); + $this->assertEquals( 'ezcFeed', get_class( $feed ) ); + $this->assertEquals( 'atom', $feed->getFeedType() ); } public function testCreateFeedNotSupported() -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components