Author: as Date: Tue Oct 30 13:32:01 2007 New Revision: 6634 Log: - Added support for 'skipHours' and 'skipDays' RSS2 feed elements.
Added: trunk/Feed/tests/rss2/regression/generate/optional/skipDays/ trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.in trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.out trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.in trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.out trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.in trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.out trunk/Feed/tests/rss2/regression/generate/optional/skipHours/ trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.in trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.out trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.in trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.out trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.in trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.out trunk/Feed/tests/rss2/regression/parse/optional/skipDays/ trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.in trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.out trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.in trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.out trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.in trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.out trunk/Feed/tests/rss2/regression/parse/optional/skipHours/ trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.in trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.out trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.in trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.out trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.in trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.out Modified: trunk/Feed/src/feed.php trunk/Feed/src/processors/rss2.php trunk/Feed/tests/regression_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 Oct 30 13:32:01 2007 @@ -188,6 +188,8 @@ case 'id': // ATOM only, required in ATOM case 'image': // icon in ATOM case 'docs': + case 'skipHours': // optional in RSS2 + case 'skipDays': // optional in RSS2 $this->feedProcessor->set( $property, $value ); break; @@ -229,6 +231,8 @@ case 'items': case 'image': // icon in ATOM case 'docs': + case 'skipHours': // optional in RSS2 + case 'skipDays': // optional in RSS2 $value = $this->feedProcessor->get( $property ); return $value; Modified: trunk/Feed/src/processors/rss2.php ============================================================================== --- trunk/Feed/src/processors/rss2.php [iso-8859-1] (original) +++ trunk/Feed/src/processors/rss2.php [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -68,10 +68,24 @@ 'rating' => array( '#' => 'string' ), 'textInput' => array( '#' => 'string' ), - 'skipHours' => array( '#' => 'string' ), - 'skipDays' => array( '#' => 'string' ), - - 'item' => array( '#' => 'node', + + 'skipHours' => array( '#' => 'none', + 'NODES' => array( + 'hour' => array( '#' => 'string', + 'MULTI' => 'hours' ), + + 'OPTIONAL' => array( 'hour' ), + ), ), + + 'skipDays' => array( '#' => 'none', + 'NODES' => array( + 'day' => array( '#' => 'string', + 'MULTI' => 'days' ), + + 'OPTIONAL' => array( 'day' ), + ), ), + + 'item' => array( '#' => 'none', 'NODES' => array( 'title' => array( '#' => 'string' ), 'link' => array( '#' => 'string' ), @@ -237,6 +251,14 @@ $this->generateImage( $this->get( 'image' ) ); break; + case 'skipHours': + $this->generateSkipHours( $this->get( 'skipHours' ) ); + break; + + case 'skipDays': + $this->generateSkipDays( $this->get( 'skipDays' ) ); + break; + default: if ( !is_array( $data ) ) { @@ -310,6 +332,54 @@ if ( !is_null( $data ) ) { $this->generateMetaData( $image, $element, $data ); + } + } + } + + /** + * Adds a skipHours node to the XML document being generated. + * + * @param ezcFeedElement $feedElement The skipHours feed element + * @ignore + */ + protected function generateSkipHours( ezcFeedElement $feedElement ) + { + $tag = $this->xml->createElement( 'skipHours' ); + $this->channel->appendChild( $tag ); + + foreach ( $this->schema->getOptional( 'skipHours' ) as $element ) + { + $data = $feedElement->$element; + if ( !is_null( $data ) ) + { + foreach ( $data as $dataNode ) + { + $this->generateMetaData( $tag, $element, $dataNode->__toString() ); + } + } + } + } + + /** + * Adds a skipDays node to the XML document being generated. + * + * @param ezcFeedElement $feedElement The skipDays feed element + * @ignore + */ + protected function generateSkipDays( ezcFeedElement $feedElement ) + { + $tag = $this->xml->createElement( 'skipDays' ); + $this->channel->appendChild( $tag ); + + foreach ( $this->schema->getOptional( 'skipDays' ) as $element ) + { + $data = $feedElement->$element; + if ( !is_null( $data ) ) + { + foreach ( $data as $dataNode ) + { + $this->generateMetaData( $tag, $element, $dataNode->__toString() ); + } } } } @@ -501,6 +571,16 @@ $this->parseImage( $feed, $image, $channelChild ); break; + case 'skipHours': + $element = $feed->add( $tagName ); + $this->parseSkipHours( $feed, $element, $channelChild ); + break; + + case 'skipDays': + $element = $feed->add( $tagName ); + $this->parseSkipDays( $feed, $element, $channelChild ); + break; + default: // check if it's part of a known module/namespace } @@ -612,5 +692,61 @@ } } } + + /** + * Parses the provided XML element object and stores it as a feed element + * of type skipHours in the provided ezcFeed object. + * + * @param ezcFeed $feed The feed object in which to store the parsed XML element as a feed element + * @param ezcFeedElement $element The feed element object that will contain skipHours + * @param DOMElement $xml The XML element object to parse + * @ignore + */ + protected function parseSkipHours( ezcFeed $feed, ezcFeedElement $element, DOMElement $xml ) + { + foreach ( $xml->childNodes as $itemChild ) + { + if ( $itemChild->nodeType === XML_ELEMENT_NODE ) + { + $tagName = $itemChild->tagName; + + switch ( $tagName ) + { + case 'hour': + $subElement = $element->add( 'hour' ); + $subElement->set( $itemChild->textContent ); + break; + } + } + } + } + + /** + * Parses the provided XML element object and stores it as a feed element + * of type skipDays in the provided ezcFeed object. + * + * @param ezcFeed $feed The feed object in which to store the parsed XML element as a feed element + * @param ezcFeedElement $element The feed element object that will contain skipDays + * @param DOMElement $xml The XML element object to parse + * @ignore + */ + protected function parseSkipDays( ezcFeed $feed, ezcFeedElement $element, DOMElement $xml ) + { + foreach ( $xml->childNodes as $itemChild ) + { + if ( $itemChild->nodeType === XML_ELEMENT_NODE ) + { + $tagName = $itemChild->tagName; + + switch ( $tagName ) + { + case 'day': + $subElement = $element->add( 'day' ); + $subElement->set( $itemChild->textContent ); + break; + } + } + } + } } ?> Modified: trunk/Feed/tests/regression_test.php ============================================================================== --- trunk/Feed/tests/regression_test.php [iso-8859-1] (original) +++ trunk/Feed/tests/regression_test.php [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -123,6 +123,17 @@ { $element->set( $subValue ); } + else if ( $subKey === 'MULTI' ) + { + foreach ( $subValue as $multi ) + { + foreach ( $multi as $subSubKey => $subSubValue ) + { + $subElement = $element->add( $subSubKey ); + $subElement->set( $subSubValue ); + } + } + } else { if ( is_array( $subValue ) ) Added: trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.in ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.in (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,7 @@ +<?php +return array( 'title' => 'Feed title', + 'link' => array( 'Feed link' ), + 'description' => 'Feed description', + 'skipDays' => array( array( 'MULTI' => array() ) ), + ); +?> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.out ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.out (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_empty.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <pubDate>XXX</pubDate> + <generator>eZ Components</generator> + <docs>http://www.rssboard.org/rss-specification</docs> + <skipDays/> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.in ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.in (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,9 @@ +<?php +return array( 'title' => 'Feed title', + 'link' => array( 'Feed link' ), + 'description' => 'Feed description', + 'skipDays' => array( array( 'MULTI' => array( array( 'day' => 'Monday' ), + array( 'day' => 'Wednesday' ), + array( 'day' => 'Sunday' ), ) ), ) + ); +?> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.out ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.out (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_multiple.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <pubDate>XXX</pubDate> + <generator>eZ Components</generator> + <docs>http://www.rssboard.org/rss-specification</docs> + <skipDays> + <day>Monday</day> + <day>Wednesday</day> + <day>Sunday</day> + </skipDays> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.in ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.in (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,7 @@ +<?php +return array( 'title' => 'Feed title', + 'link' => array( 'Feed link' ), + 'description' => 'Feed description', + 'skipDays' => array( array( 'MULTI' => array( array( 'day' => 'Monday' ), ) ), ) + ); +?> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.out ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.out (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipDays/skipDays_single.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <pubDate>XXX</pubDate> + <generator>eZ Components</generator> + <docs>http://www.rssboard.org/rss-specification</docs> + <skipDays> + <day>Monday</day> + </skipDays> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.in ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.in (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,7 @@ +<?php +return array( 'title' => 'Feed title', + 'link' => array( 'Feed link' ), + 'description' => 'Feed description', + 'skipHours' => array( array( 'MULTI' => array() ) ), + ); +?> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.out ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.out (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_empty.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <pubDate>XXX</pubDate> + <generator>eZ Components</generator> + <docs>http://www.rssboard.org/rss-specification</docs> + <skipHours/> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.in ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.in (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,9 @@ +<?php +return array( 'title' => 'Feed title', + 'link' => array( 'Feed link' ), + 'description' => 'Feed description', + 'skipHours' => array( array( 'MULTI' => array( array( 'hour' => 0 ), + array( 'hour' => 5 ), + array( 'hour' => 23 ), ) ), ) + ); +?> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.out ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.out (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_multiple.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <pubDate>XXX</pubDate> + <generator>eZ Components</generator> + <docs>http://www.rssboard.org/rss-specification</docs> + <skipHours> + <hour>0</hour> + <hour>5</hour> + <hour>23</hour> + </skipHours> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.in ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.in (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,7 @@ +<?php +return array( 'title' => 'Feed title', + 'link' => array( 'Feed link' ), + 'description' => 'Feed description', + 'skipHours' => array( array( 'MULTI' => array( array( 'hour' => 0 ), ) ), ) + ); +?> Added: trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.out ============================================================================== --- trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.out (added) +++ trunk/Feed/tests/rss2/regression/generate/optional/skipHours/skipHours_single.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <pubDate>XXX</pubDate> + <generator>eZ Components</generator> + <docs>http://www.rssboard.org/rss-specification</docs> + <skipHours> + <hour>0</hour> + </skipHours> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.in ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.in (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <skipDays/> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.out ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.out (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_empty.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,13 @@ +<?php +$feed = new ezcFeed( 'rss2' ); + +$feed->title = 'Feed title'; + +$link = $feed->add( 'link' ); +$link->set( 'Feed link' ); + +$feed->description = 'Feed description'; +$feed->skipDays = 'xxx';//null; + +return $feed; +?> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.in ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.in (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <skipDays> + <day>Monday</day> + <day>Wednesday</day> + <day>Sunday</day> + </skipDays> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.out ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.out (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_multiple.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,22 @@ +<?php +$feed = new ezcFeed( 'rss2' ); + +$feed->title = 'Feed title'; + +$link = $feed->add( 'link' ); +$link->set( 'Feed link' ); + +$feed->description = 'Feed description'; +$skipDays = $feed->add( 'skipDays' ); + +$day = $skipDays->add( 'day' ); +$day->set( 'Monday' ); + +$day = $skipDays->add( 'day' ); +$day->set( 'Wednesday' ); + +$day = $skipDays->add( 'day' ); +$day->set( 'Sunday' ); + +return $feed; +?> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.in ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.in (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <skipDays> + <day>Monday</day> + </skipDays> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.out ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.out (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipDays/skipDays_single.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,15 @@ +<?php +$feed = new ezcFeed( 'rss2' ); + +$feed->title = 'Feed title'; + +$link = $feed->add( 'link' ); +$link->set( 'Feed link' ); + +$feed->description = 'Feed description'; +$skipDays = $feed->add( 'skipDays' ); +$day = $skipDays->add( 'day' ); +$day->set( 'Monday' ); + +return $feed; +?> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.in ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.in (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <skipHours/> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.out ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.out (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_empty.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,13 @@ +<?php +$feed = new ezcFeed( 'rss2' ); + +$feed->title = 'Feed title'; + +$link = $feed->add( 'link' ); +$link->set( 'Feed link' ); + +$feed->description = 'Feed description'; +$feed->skipHours = null; + +return $feed; +?> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.in ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.in (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <skipHours> + <hour>0</hour> + <hour>5</hour> + <hour>23</hour> + </skipHours> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.out ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.out (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_multiple.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,22 @@ +<?php +$feed = new ezcFeed( 'rss2' ); + +$feed->title = 'Feed title'; + +$link = $feed->add( 'link' ); +$link->set( 'Feed link' ); + +$feed->description = 'Feed description'; +$skipHours = $feed->add( 'skipHours' ); + +$hour = $skipHours->add( 'hour' ); +$hour->set( 0 ); + +$hour = $skipHours->add( 'hour' ); +$hour->set( 5 ); + +$hour = $skipHours->add( 'hour' ); +$hour->set( 23 ); + +return $feed; +?> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.in ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.in (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.in [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<rss version="2.0"> + <channel> + <title>Feed title</title> + <link>Feed link</link> + <description>Feed description</description> + <skipHours> + <hour>0</hour> + </skipHours> + </channel> +</rss> Added: trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.out ============================================================================== --- trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.out (added) +++ trunk/Feed/tests/rss2/regression/parse/optional/skipHours/skipHours_single.out [iso-8859-1] Tue Oct 30 13:32:01 2007 @@ -1,0 +1,15 @@ +<?php +$feed = new ezcFeed( 'rss2' ); + +$feed->title = 'Feed title'; + +$link = $feed->add( 'link' ); +$link->set( 'Feed link' ); + +$feed->description = 'Feed description'; +$skipHours = $feed->add( 'skipHours' ); +$hour = $skipHours->add( 'hour' ); +$hour->set( 0 ); + +return $feed; +?> -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components