Author: as
Date: Mon Nov 19 11:47:32 2007
New Revision: 6760

Log:
- Added support for 'contributor' ATOM feed sub-element.

Added:
    trunk/Feed/tests/atom/regression/generate/entry/contributor/
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.in
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.out
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.in
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.out
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.in
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.out
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.in
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.out
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.in
    
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.out
    trunk/Feed/tests/atom/regression/parse/entry/contributor/
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.in
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.out
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.in
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.out
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.in
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.out
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.in
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.out
    trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.in
    
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.out
Modified:
    trunk/Feed/src/processors/atom.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] Mon Nov 19 11:47:32 2007
@@ -727,6 +727,7 @@
                         break;
 
                     case 'author':
+                    case 'contributor':
                         foreach ( $data as $dataNode )
                         {
                             $this->generatePerson( $entryTag, $dataNode, 
$element );
@@ -964,6 +965,7 @@
                         break;
 
                     case 'author':
+                    case 'contributor':
                         $subElement = $element->add( $tagName );
                         foreach ( $itemChild->childNodes as $subChild )
                         {

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.in
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.in
 [iso-8859-1] Mon Nov 19 11:47:32 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' ) ),
+              'item' => array( array( 'id' => 'Entry id',
+                                      'title' => 'Entry title',
+                                      'updated' => 'Entry updated',
+                                      'content' => 'Entry content',
+                                                                         
'contributor' => array( array() ) ) ) );
+?>

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_empty.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,1 @@
+There was no data submitted for required channel attribute 'name'.

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.in
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.in
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,17 @@
+<?php
+return array( 'id' => 'Feed id',
+              'title' => array( array( '#' => 'Feed title',
+                                       'type' => '' ) ),
+              'updated' => 'Feed updated',
+              'author' => array( array( 'name' => 'Author name' ) ),
+              'item' => array( array( 'id' => 'Entry id',
+                                      'title' => 'Entry title',
+                                      'updated' => 'Entry updated',
+                                      'content' => 'Entry content',
+                                                                         
'contributor' => array( array( 'name' => 'Entry contributor name 1',
+                                                                     'email' 
=> 'Entry contributor email 1',
+                                                                     'uri' => 
'Entry contributor uri 1' ),
+                                                              array( 'name' => 
'Entry contributor name 2',
+                                                                     'email' 
=> 'Entry contributor email 2',
+                                                                     'uri' => 
'Entry contributor uri 2' ), ) ) ) );
+?>

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_multiple.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,25 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>XXX</updated>
+    <content>Entry content</content>
+    <contributor>
+      <name>Entry contributor name 1</name>
+      <email>Entry contributor email 1</email>
+      <uri>Entry contributor uri 1</uri>
+    </contributor>
+    <contributor>
+      <name>Entry contributor name 2</name>
+      <email>Entry contributor email 2</email>
+      <uri>Entry contributor uri 2</uri>
+    </contributor>
+  </entry>
+</feed> 

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.in
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.in
 [iso-8859-1] Mon Nov 19 11:47:32 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' ) ),
+              'item' => array( array( 'id' => 'Entry id',
+                                      'title' => 'Entry title',
+                                      'updated' => 'Entry updated',
+                                      'content' => 'Entry content',
+                                                                         
'contributor' => array( array( 'name' => 'Entry contributor name',
+                                                                     'email' 
=> 'Entry contributor email' ), ) ) ) );
+?>

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email+uri.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,19 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>XXX</updated>
+    <content>Entry content</content>
+    <contributor>
+      <name>Entry contributor name</name>
+      <email>Entry contributor email</email>
+    </contributor>
+  </entry>
+</feed> 

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.in
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.in
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,14 @@
+<?php
+return array( 'id' => 'Feed id',
+              'title' => array( array( '#' => 'Feed title',
+                                       'type' => '' ) ),
+              'updated' => 'Feed updated',
+              'author' => array( array( 'name' => 'Author name' ) ),
+              'item' => array( array( 'id' => 'Entry id',
+                                      'title' => 'Entry title',
+                                      'updated' => 'Entry updated',
+                                      'content' => 'Entry content',
+                                                                         
'contributor' => array( array( 'name' => 'Entry contributor name',
+                                                                     'email' 
=> 'Entry contributor email',
+                                                                     'uri' => 
'Entry contributor uri' ), ) ) ) );
+?>

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name+email.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,20 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>XXX</updated>
+    <content>Entry content</content>
+    <contributor>
+      <name>Entry contributor name</name>
+      <email>Entry contributor email</email>
+      <uri>Entry contributor uri</uri>
+    </contributor>
+  </entry>
+</feed> 

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.in 
(added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.in 
[iso-8859-1] Mon Nov 19 11:47:32 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' ) ),
+              'item' => array( array( 'id' => 'Entry id',
+                                      'title' => 'Entry title',
+                                      'updated' => 'Entry updated',
+                                      'content' => 'Entry content',
+                                                                         
'contributor' => array( array( 'name' => 'Entry contributor name' ), ) ) ) );
+?>

Added: 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/generate/entry/contributor/contributor_name.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,18 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>XXX</updated>
+    <content>Entry content</content>
+    <contributor>
+      <name>Entry contributor name</name>
+    </contributor>
+  </entry>
+</feed> 

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.in 
(added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.in 
[iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,12 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>2007-11-14T16:23:40+01:00</updated>
+    <contributor/>
+  </entry>
+</feed>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.out 
(added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_empty.out 
[iso-8859-1] Mon Nov 19 11:47:32 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';
+
+$entry = $feed->add( 'entry' );
+$entry->id = 'Entry id';
+$entry->title = 'Entry title';
+$entry->updated = 1195053820;
+
+$contributor = $entry->add( 'contributor' );
+
+return $feed;
+?>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.in
 (added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.in
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,21 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>2007-11-14T16:23:40+01:00</updated>
+    <contributor>
+      <name>Entry contributor name 1</name>
+      <email>Entry contributor email 1</email>
+      <uri>Entry contributor uri 1</uri>
+    </contributor>
+    <contributor>
+      <name>Entry contributor name 2</name>
+      <email>Entry contributor email 2</email>
+      <uri>Entry contributor uri 2</uri>
+    </contributor>
+  </entry>
+</feed>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_multiple.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,25 @@
+<?php
+$feed = new ezcFeed( 'atom' );
+
+$feed->id = 'Feed id';
+$feed->title = 'Feed title';
+$feed->title->type = 'text';
+$feed->updated = 'Feed updated';
+
+$entry = $feed->add( 'entry' );
+$entry->id = 'Entry id';
+$entry->title = 'Entry title';
+$entry->updated = 1195053820;
+
+$contributor = $entry->add( 'contributor' );
+$contributor->name = "Entry contributor name 1";
+$contributor->email = "Entry contributor email 1";
+$contributor->uri = "Entry contributor uri 1";
+
+$contributor = $entry->add( 'contributor' );
+$contributor->name = "Entry contributor name 2";
+$contributor->email = "Entry contributor email 2";
+$contributor->uri = "Entry contributor uri 2";
+
+return $feed;
+?>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.in
 (added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.in
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,16 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>2007-11-14T16:23:40+01:00</updated>
+    <contributor>
+      <name>Entry contributor name</name>
+      <email>Entry contributor email</email>
+      <uri>Entry contributor uri</uri>
+    </contributor>
+  </entry>
+</feed>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email+uri.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,20 @@
+<?php
+$feed = new ezcFeed( 'atom' );
+
+$feed->id = 'Feed id';
+$feed->title = 'Feed title';
+$feed->title->type = 'text';
+$feed->updated = 'Feed updated';
+
+$entry = $feed->add( 'entry' );
+$entry->id = 'Entry id';
+$entry->title = 'Entry title';
+$entry->updated = 1195053820;
+
+$contributor = $entry->add( 'contributor' );
+$contributor->name = "Entry contributor name";
+$contributor->email = "Entry contributor email";
+$contributor->uri = "Entry contributor uri";
+
+return $feed;
+?>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.in
 (added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.in
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,15 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>2007-11-14T16:23:40+01:00</updated>
+    <contributor>
+      <name>Entry contributor name</name>
+      <email>Entry contributor email</email>
+    </contributor>
+  </entry>
+</feed>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.out
 (added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name+email.out
 [iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,19 @@
+<?php
+$feed = new ezcFeed( 'atom' );
+
+$feed->id = 'Feed id';
+$feed->title = 'Feed title';
+$feed->title->type = 'text';
+$feed->updated = 'Feed updated';
+
+$entry = $feed->add( 'entry' );
+$entry->id = 'Entry id';
+$entry->title = 'Entry title';
+$entry->updated = 1195053820;
+
+$contributor = $entry->add( 'contributor' );
+$contributor->name = "Entry contributor name";
+$contributor->email = "Entry contributor email";
+
+return $feed;
+?>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.in
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.in 
(added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.in 
[iso-8859-1] Mon Nov 19 11:47:32 2007
@@ -1,0 +1,14 @@
+<?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>
+  <entry>
+    <id>Entry id</id>
+    <title>Entry title</title>
+    <updated>2007-11-14T16:23:40+01:00</updated>
+    <contributor>
+      <name>Entry contributor name</name>
+    </contributor>
+  </entry>
+</feed>

Added: 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.out
==============================================================================
--- 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.out 
(added)
+++ 
trunk/Feed/tests/atom/regression/parse/entry/contributor/contributor_name.out 
[iso-8859-1] Mon Nov 19 11:47:32 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';
+
+$entry = $feed->add( 'entry' );
+$entry->id = 'Entry id';
+$entry->title = 'Entry title';
+$entry->updated = 1195053820;
+
+$contributor = $entry->add( 'contributor' );
+$contributor->name = "Entry contributor name";
+
+return $feed;
+?>


-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to