Author: as Date: Wed Nov 14 14:20:41 2007 New Revision: 6727 Log: - Added support for 'link' ATOM feed element.
Added: trunk/Feed/src/exceptions/only_one_value_allowed.php (with props) trunk/Feed/tests/atom/regression/generate/optional/link/ trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.in trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.out trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.in trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.out trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.in trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.out trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.in trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.out trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.in trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.out trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.in trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.out trunk/Feed/tests/atom/regression/generate/optional/link/link_href.in trunk/Feed/tests/atom/regression/generate/optional/link/link_href.out trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.in trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.out trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.in trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.out trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.in trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.out trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.in trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.out trunk/Feed/tests/atom/regression/parse/optional/link/ trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.in trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.out trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.in trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.out trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.in trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.out trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.in trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.out trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.in trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.out trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.in trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.out trunk/Feed/tests/atom/regression/parse/optional/link/link_href.in trunk/Feed/tests/atom/regression/parse/optional/link/link_href.out trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.in trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.out Modified: trunk/Feed/design/class_diagram.png trunk/Feed/docs/tutorial.txt trunk/Feed/src/feed_autoload.php trunk/Feed/src/processors/atom.php Modified: trunk/Feed/design/class_diagram.png ============================================================================== Binary files - no diff available. Modified: trunk/Feed/docs/tutorial.txt ============================================================================== --- trunk/Feed/docs/tutorial.txt [iso-8859-1] (original) +++ trunk/Feed/docs/tutorial.txt [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -256,6 +256,13 @@ `````````` All ATOM feeds must be identified with the application/atom+xml media type. + + +Self link +````````` + +All ATOM feeds should have a *link* feed element with *rel="self"* which +points back to the feed itself (with the *href* attribute). Specifications and RFCs Added: trunk/Feed/src/exceptions/only_one_value_allowed.php ============================================================================== --- trunk/Feed/src/exceptions/only_one_value_allowed.php (added) +++ trunk/Feed/src/exceptions/only_one_value_allowed.php [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,30 @@ +<?php +/** + * File containing the ezcFeedOnlyOneValueAllowedException class. + * + * @package Feed + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + * @filesource + */ + +/** + * Thrown when some elements value is not a single value but an array. + * + * @package Feed + * @version //autogentag// + */ +class ezcFeedOnlyOneValueAllowedException extends ezcFeedException +{ + /** + * Constructs a new ezcFeedOnlyOneValueAllowedException. + * + * @param string $attribute The attribute which caused the exception + */ + public function __construct( $attribute ) + { + parent::__construct( "The attribute '{$attribute}' supports only singular values." ); + } +} +?> Propchange: trunk/Feed/src/exceptions/only_one_value_allowed.php ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/Feed/src/feed_autoload.php ============================================================================== --- trunk/Feed/src/feed_autoload.php [iso-8859-1] (original) +++ trunk/Feed/src/feed_autoload.php [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -13,6 +13,7 @@ 'ezcFeedException' => 'Feed/exceptions/exception.php', 'ezcFeedAtLeastOneItemDataRequiredException' => 'Feed/exceptions/one_item_data_required.php', 'ezcFeedCanNotParseException' => 'Feed/exceptions/can_not_parse.php', + 'ezcFeedOnlyOneValueAllowedException' => 'Feed/exceptions/only_one_value_allowed.php', 'ezcFeedParseErrorException' => 'Feed/exceptions/parse_error.php', 'ezcFeedRequiredMetaDataMissingException' => 'Feed/exceptions/meta_data_missing.php', 'ezcFeedUnsupportedTypeException' => 'Feed/exceptions/unsupported_type.php', Modified: trunk/Feed/src/processors/atom.php ============================================================================== --- trunk/Feed/src/processors/atom.php [iso-8859-1] (original) +++ trunk/Feed/src/processors/atom.php [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -50,7 +50,18 @@ 'MULTI' => 'authors' ), - 'link' => array( '#' => 'string' ), + 'link' => array( '#' => 'none', + 'ATTRIBUTES' => array( 'href' => 'string', + 'rel' => 'string', + 'type' => 'string', + 'hreflang' => 'string', + 'title' => 'string', + 'length' => 'string' ), + + 'REQUIRED_ATTRIBUTES' => array( 'href' ), + + 'MULTI' => 'links' ), + 'category' => array( '#' => 'none', 'ATTRIBUTES' => array( 'term' => 'string', 'scheme' => 'string', @@ -234,6 +245,32 @@ } break; + case 'link': + $unique = array(); + foreach ( $data as $dataNode ) + { + if ( ( isset( $dataNode->rel ) && $dataNode->rel === 'alternate' ) + && isset( $dataNode->type ) + && isset( $dataNode->hreflang ) ) + { + foreach ( $unique as $obj ) + { + if ( $obj['type'] === $dataNode->type + && $obj['hreflang'] === $dataNode->hreflang ) + { + throw new ezcFeedOnlyOneValueAllowedException( 'rel="alternate"' ); + } + } + + $unique[] = array( 'type' => $dataNode->type, + 'hreflang' => $dataNode->hreflang ); + + } + + $this->generateNode( $this->channel, $element, $dataNode ); + } + break; + default: foreach ( $data as $dataNode ) { @@ -266,7 +303,7 @@ if ( isset( $dataNode->$attribute ) ) { $val = $dataNode->$attribute; - if ( $attribute === 'type' ) + if ( $attribute === 'type' && $element !== 'link' ) { switch ( $val ) { @@ -431,6 +468,7 @@ break; case 'category': + case 'link': $element = $feed->add( $tagName ); break; @@ -447,7 +485,7 @@ foreach ( ezcFeedTools::getAttributes( $channelChild ) as $key => $value ) { - if ( in_array( $tagName, array( 'category' ) ) ) + if ( in_array( $tagName, array( 'category', 'link' ) ) ) { $element->$key = $value; } Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,8 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array() ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_empty.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,1 @@ +There was no data submitted for required channel attribute 'href'. Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,13 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href', + 'rel' => 'Link rel', + 'type' => 'Link type', + 'hreflang' => 'Link hreflang', + 'title' => 'Link title', + 'length' => 'Link length' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title+length.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href" rel="Link rel" type="Link type" hreflang="Link hreflang" title="Link title" length="Link length"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,12 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href', + 'rel' => 'Link rel', + 'type' => 'Link type', + 'hreflang' => 'Link hreflang', + 'title' => 'Link title' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang+title.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href" rel="Link rel" type="Link type" hreflang="Link hreflang" title="Link title"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,11 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href', + 'rel' => 'Link rel', + 'type' => 'Link type', + 'hreflang' => 'Link hreflang' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type+hreflang.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href" rel="Link rel" type="Link type" hreflang="Link hreflang"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href', + 'rel' => 'Link rel', + 'type' => 'Link type' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel+type.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href" rel="Link rel" type="Link type"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,9 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href', + 'rel' => 'Link rel' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href+rel.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href" rel="Link rel"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,8 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_href.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_href.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_href.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,19 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href 1', + 'rel' => 'Link rel 1', + 'type' => 'Link type 1', + 'hreflang' => 'Link hreflang 1', + 'title' => 'Link title 1', + 'length' => 'Link length 1' ), + array( 'href' => 'Link href 2', + 'rel' => 'Link rel 2', + 'type' => 'Link type 2', + 'hreflang' => 'Link hreflang 2', + 'title' => 'Link title 2', + 'length' => 'Link length 2' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href 1" rel="Link rel 1" type="Link type 1" hreflang="Link hreflang 1" title="Link title 1" length="Link length 1"/> + <link href="Link href 2" rel="Link rel 2" type="Link type 2" hreflang="Link hreflang 2" title="Link title 2" length="Link length 2"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,19 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href 1', + 'rel' => 'alternate', + 'type' => 'SAME TYPE', + 'hreflang' => 'SAME HREFLANG', + 'title' => 'Link title 1', + 'length' => 'Link length 1' ), + array( 'href' => 'Link href 2', + 'rel' => 'alternate', + 'type' => 'SAME TYPE', + 'hreflang' => 'SAME HREFLANG', + 'title' => 'Link title 2', + 'length' => 'Link length 2' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_broken.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,1 @@ +The attribute 'rel="alternate"' supports only singular values. Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,19 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'href' => 'Link href 1', + 'rel' => 'alternate', + 'type' => 'Link type 1', + 'hreflang' => 'Link hreflang 1', + 'title' => 'Link title 1', + 'length' => 'Link length 1' ), + array( 'href' => 'Link href 2', + 'rel' => 'alternate', + 'type' => 'Link type 2', + 'hreflang' => 'Link hreflang 2', + 'title' => 'Link title 2', + 'length' => 'Link length 2' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_multiple_alternate_correct.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>XXX</updated> + <author> + <name>Author name</name> + </author> + <link href="Link href 1" rel="alternate" type="Link type 1" hreflang="Link hreflang 1" title="Link title 1" length="Link length 1"/> + <link href="Link href 2" rel="alternate" type="Link type 2" hreflang="Link hreflang 2" title="Link title 2" length="Link length 2"/> +</feed> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.in ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.in (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,8 @@ +<?php +return array( 'id' => 'Feed id', + 'title' => array( array( '#' => 'Feed title', + 'type' => '' ) ), + 'updated' => 'Feed updated', + 'author' => array( array( 'name' => 'Author name' ) ), + 'link' => array( array( 'rel' => 'Link rel' ) ) ); +?> Added: trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.out ============================================================================== --- trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.out (added) +++ trunk/Feed/tests/atom/regression/generate/optional/link/link_rel.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,1 @@ +There was no data submitted for required channel attribute 'href'. Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_empty.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,12 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); + +return $feed; +?> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link href="Link href" rel="Link rel" type="Link type" hreflang="Link hreflang" + title="Link title" length="Link length"/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title+length.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,18 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href'; +$link->rel = 'Link rel'; +$link->type = 'Link type'; +$link->hreflang = 'Link hreflang'; +$link->title = 'Link title'; +$link->length = 'Link length'; + +return $feed; +?> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link href="Link href" rel="Link rel" type="Link type" hreflang="Link hreflang" + title="Link title"/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang+title.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,17 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href'; +$link->rel = 'Link rel'; +$link->type = 'Link type'; +$link->hreflang = 'Link hreflang'; +$link->title = 'Link title'; + +return $feed; +?> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link href="Link href" rel="Link rel" type="Link type" hreflang="Link hreflang"/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type+hreflang.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,16 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href'; +$link->rel = 'Link rel'; +$link->type = 'Link type'; +$link->hreflang = 'Link hreflang'; + +return $feed; +?> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link href="Link href" rel="Link rel" type="Link type"/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel+type.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,15 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href'; +$link->rel = 'Link rel'; +$link->type = 'Link type'; + +return $feed; +?> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link href="Link href" rel="Link rel"/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href+rel.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,14 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href'; +$link->rel = 'Link rel'; + +return $feed; +?> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link href="Link href"/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_href.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_href.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_href.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,13 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href'; + +return $feed; +?> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.in ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.in (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.in [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>Feed id</id> + <title type="text">Feed title</title> + <updated>Feed updated</updated> + <link href="Link href 1" rel="Link rel 1" type="Link type 1" hreflang="Link hreflang 1" + title="Link title 1" length="Link length 1"/> + <link href="Link href 2" rel="Link rel 2" type="Link type 2" hreflang="Link hreflang 2" + title="Link title 2" length="Link length 2"/> +</feed> Added: trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.out ============================================================================== --- trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.out (added) +++ trunk/Feed/tests/atom/regression/parse/optional/link/link_multiple.out [iso-8859-1] Wed Nov 14 14:20:41 2007 @@ -1,0 +1,26 @@ +<?php +$feed = new ezcFeed( 'atom' ); + +$feed->id = 'Feed id'; +$feed->title = 'Feed title'; +$feed->title->type = 'text'; +$feed->updated = 'Feed updated'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href 1'; +$link->rel = 'Link rel 1'; +$link->type = 'Link type 1'; +$link->hreflang = 'Link hreflang 1'; +$link->title = 'Link title 1'; +$link->length = 'Link length 1'; + +$link = $feed->add( 'link' ); +$link->href = 'Link href 2'; +$link->rel = 'Link rel 2'; +$link->type = 'Link type 2'; +$link->hreflang = 'Link hreflang 2'; +$link->title = 'Link title 2'; +$link->length = 'Link length 2'; + +return $feed; +?> -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components