Kaynağa Gözat

Zend_Feed_Reader: Updated all (every last one!) get/setAuthor(s) methods to reflect a more detailed data collection including names, emails and urls.
This breaks compatibility with prior mini releases - restoration of the original result format will be detailed in 1.10 migration guide.


git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19725 44c647ce-9c0f-0410-b52a-842ac1e357ba

padraic 16 yıl önce
ebeveyn
işleme
863996946a
26 değiştirilmiş dosya ile 549 ekleme ve 309 silme
  1. 20 0
      library/Zend/Feed/Reader.php
  2. 51 0
      library/Zend/Feed/Reader/Collection/Author.php
  3. 34 29
      library/Zend/Feed/Reader/Entry/Rss.php
  4. 29 35
      library/Zend/Feed/Reader/Extension/Atom/Entry.php
  5. 27 39
      library/Zend/Feed/Reader/Extension/Atom/Feed.php
  6. 8 9
      library/Zend/Feed/Reader/Extension/DublinCore/Entry.php
  7. 17 7
      library/Zend/Feed/Reader/Extension/DublinCore/Feed.php
  8. 2 2
      library/Zend/Feed/Reader/Feed/Atom.php
  9. 43 17
      library/Zend/Feed/Reader/Feed/Rss.php
  10. 8 7
      tests/Zend/Feed/Reader/Entry/AtomStandaloneEntryTest.php
  11. 16 14
      tests/Zend/Feed/Reader/Entry/AtomTest.php
  12. 89 43
      tests/Zend/Feed/Reader/Entry/RssTest.php
  13. 8 7
      tests/Zend/Feed/Reader/Feed/AtomSourceTest.php
  14. 16 14
      tests/Zend/Feed/Reader/Feed/AtomTest.php
  15. 140 49
      tests/Zend/Feed/Reader/Feed/RssTest.php
  16. 3 3
      tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss090.xml
  17. 3 3
      tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss091.xml
  18. 3 3
      tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss092.xml
  19. 3 3
      tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss093.xml
  20. 3 3
      tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss094.xml
  21. 3 3
      tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss10.xml
  22. 3 3
      tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss20.xml
  23. 4 4
      tests/Zend/Feed/Reader/Integration/H-OnlineComAtom10Test.php
  24. 4 4
      tests/Zend/Feed/Reader/Integration/LautDeRdfTest.php
  25. 6 4
      tests/Zend/Feed/Reader/Integration/WordpressAtom10Test.php
  26. 6 4
      tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php

+ 20 - 0
library/Zend/Feed/Reader.php

@@ -696,4 +696,24 @@ class Zend_Feed_Reader
         self::registerExtension('Thread');
         self::registerExtension('Podcast');
     }
+    
+    /**
+     * Utility method to apply array_unique operation to a multidimensional
+     * array.
+     *
+     * @param array
+     * @return array
+     */
+    public static function arrayUnique(array $array)
+    {
+        foreach ($array as &$value) {
+            $value = serialize($value);
+        }
+        $array = array_unique($array);
+        foreach ($array as &$value) {
+            $value = unserialize($value);
+        }
+        return $array;
+    }
+ 
 }

+ 51 - 0
library/Zend/Feed/Reader/Collection/Author.php

@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category   Zend
+ * @package    Zend_Feed_Reader
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ * @version    $Id$
+ */
+ 
+/**
+ * @see Zend_Feed_Reader_Collection_CollectionAbstract
+ */
+require_once 'Zend/Feed/Reader/Collection/CollectionAbstract.php';
+
+/**
+ * @category   Zend
+ * @package    Zend_Feed_Reader
+ * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license    http://framework.zend.com/license/new-bsd     New BSD License
+ */
+class Zend_Feed_Reader_Collection_Author
+extends Zend_Feed_Reader_Collection_CollectionAbstract
+{
+
+    /**
+     * Return a simple array of the most relevant slice of
+     * the author values, i.e. all author names.
+     *
+     * @return array
+     */
+    public function getValues() {
+        $authors = array();
+        foreach ($this->getIterator() as $element) {
+            $authors[] = $element['name'];
+        }
+        return array_unique($authors);
+    }
+
+}

+ 34 - 29
library/Zend/Feed/Reader/Entry/Rss.php

@@ -159,45 +159,50 @@ class Zend_Feed_Reader_Entry_Rss extends Zend_Feed_Reader_EntryAbstract implemen
         if (array_key_exists('authors', $this->_data)) {
             return $this->_data['authors'];
         }
-
+        
         $authors = array();
-        // @todo: create a list from all potential sources rather than from alternatives
-        if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 &&
-            $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
-            $list = $this->_xpath->evaluate($this->_xpathQueryRss.'//author');
-        } else {
-            $list = $this->_xpath->evaluate($this->_xpathQueryRdf.'//rss:author');
-        }
-        if (!$list->length) {
-            if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
-                $list = $this->_xpath->query('//author');
-            } else {
-                $list = $this->_xpath->query('//rss:author');
+        $authors_dc = $this->getExtension('DublinCore')->getAuthors();
+        if (!empty($authors_dc)) {
+            foreach ($authors_dc as $author) {
+                $authors[] = array(
+                    'name' => $author['name']
+                );
             }
         }
-
+        
+        if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
+        && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
+            $list = $this->_xpath->query($this->_xpathQueryRss . '//author');
+        } else {
+            $list = $this->_xpath->query($this->_xpathQueryRdf . '//rss:author');
+        }
         if ($list->length) {
             foreach ($list as $author) {
-                if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_20
-                    && preg_match("/\(([^\)]+)\)/", $author->nodeValue, $matches, PREG_OFFSET_CAPTURE)
-                ) {
-                    // source name from RSS 2.0 <author>
-                    // format "joe@example.com (Joe Bloggs)"
-                    $authors[] = $matches[1][0];
-                } else {
-                    $authors[] = $author->nodeValue;
-                }
+                $string = trim($author->nodeValue);
+                $email = null;
+                $name = null;
+                $data = array();
+                // Pretty rough parsing - but it's a catchall
+                if (preg_match("/^.*@[^ ]*/", $string, $matches)) {
+                    $data['email'] = trim($matches[0]);
+                    if (preg_match("/\((.*)\)$/", $string, $matches)) {
+                        $data['name'] = $matches[1];
+                    }
+                    $authors[] = $data;
+                } 
             }
-
-            $authors = array_unique($authors);
         }
 
-        if (empty($authors)) {
-            $authors = $this->getExtension('DublinCore')->getAuthors();
+        if (count($authors) == 0) {
+            $authors = $this->getExtension('Atom')->getAuthors();
+        } else {
+            $authors = new Zend_Feed_Reader_Collection_Author(
+                Zend_Feed_Reader::arrayUnique($authors)
+            );
         }
 
-        if (empty($authors)) {
-            $authors = $this->getExtension('Atom')->getAuthors();
+        if (count($authors) == 0) {
+            $authors = null;
         }
 
         $this->_data['authors'] = $authors;

+ 29 - 35
library/Zend/Feed/Reader/Extension/Atom/Entry.php

@@ -86,33 +86,34 @@ class Zend_Feed_Reader_Extension_Atom_Entry
             return $this->_data['authors'];
         }
 
-        $authors = $this->getXpath()->query(
-            $this->getXpathPrefix() . '//atom:author' . '|'
-                . $this->getXpathPrefix(). '//atom:contributor'
-        );
+        $authors = array();
+        $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom:author');
 
-        if (!$authors->length) {
-            $authors = $this->getXpath()->query(
-                '//atom:author' . '|' . '//atom:contributor'
-            );
+        if (!$list->length) {
+            /**
+             * TODO: Limit query to feed level els only!
+             */
+            $list = $this->getXpath()->query('//atom:author');
         }
 
-        $people = array();
-
-        if ($authors->length) {
-            foreach ($authors as $author) {
+        if ($list->length) {
+            foreach ($list as $author) {
                 $author = $this->_getAuthor($author);
-
                 if (!empty($author)) {
-                    $people[] = $author;
+                    $authors[] = $author;
                 }
             }
         }
 
-        $people = array_unique($people);
-
-        $this->_data['authors'] = $people;
+        if (count($authors) == 0) {
+            $authors = null;
+        } else {
+            $authors = new Zend_Feed_Reader_Collection_Author(
+                Zend_Feed_Reader::arrayUnique($authors)
+            );
+        }
 
+        $this->_data['authors'] = $authors;
         return $this->_data['authors'];
     }
 
@@ -561,35 +562,28 @@ class Zend_Feed_Reader_Extension_Atom_Entry
      */
     protected function _getAuthor(DOMElement $element)
     {
-        $email = null;
-        $name  = null;
-        $uri   = null;
+        $author = array();
 
         $emailNode = $element->getElementsByTagName('email');
         $nameNode  = $element->getElementsByTagName('name');
         $uriNode   = $element->getElementsByTagName('uri');
-
-        if ($emailNode->length) {
-            $email = $emailNode->item(0)->nodeValue;
+        
+        if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) {
+            $author['email'] = $emailNode->item(0)->nodeValue;
         }
 
-        if ($nameNode->length) {
-            $name = $nameNode->item(0)->nodeValue;
+        if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) {
+            $author['name'] = $nameNode->item(0)->nodeValue;
         }
 
-        if ($uriNode->length) {
-            $uri = $uriNode->item(0)->nodeValue;
+        if ($uriNode->length && strlen($uriNode->item(0)->nodeValue) > 0) {
+            $author['uri'] = $uriNode->item(0)->nodeValue;
         }
 
-        if (!empty($email)) {
-            return $email . (empty($name) ? '' : ' (' . $name . ')');
-        } else if (!empty($name)) {
-            return $name;
-        } else if (!empty($uri)) {
-            return $uri;
+        if (empty($author)) {
+            return null;
         }
-
-        return null;
+        return $author;
     }
 
     /**

+ 27 - 39
library/Zend/Feed/Reader/Extension/Atom/Feed.php

@@ -35,6 +35,11 @@ require_once 'Zend/Date.php';
 require_once 'Zend/Uri.php';
 
 /**
+ * @see Zend_Feed_Reader_Collection_Author
+ */
+require_once 'Zend/Feed/Reader/Collection/Author.php';
+
+/**
  * @category   Zend
  * @package    Zend_Feed_Reader
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
@@ -71,38 +76,28 @@ class Zend_Feed_Reader_Extension_Atom_Feed
             return $this->_data['authors'];
         }
 
-        $authors = $this->_xpath->query('//atom:author');
-        $contributors = $this->_xpath->query('//atom:contributor');
+        $list = $this->_xpath->query('//atom:author');
 
-        $people = array();
+        $authors = array();
 
-        if ($authors->length) {
-            foreach ($authors as $author) {
+        if ($list->length) {
+            foreach ($list as $author) {
                 $author = $this->_getAuthor($author);
-
                 if (!empty($author)) {
-                    $people[] = $author;
-                }
-            }
-        }
-
-        if ($contributors->length) {
-            foreach ($contributors as $contributor) {
-                $contributor = $this->_getAuthor($contributor);
-
-                if (!empty($contributor)) {
-                    $people[] = $contributor;
+                    $authors[] = $author;
                 }
             }
         }
 
-        if (empty($people)) {
-            $people = null;
+        if (count($authors) == 0) {
+            $authors = null;
         } else {
-            $people = array_unique($people);
+            $authors = new Zend_Feed_Reader_Collection_Author(
+                Zend_Feed_Reader::arrayUnique($authors)
+            );
         }
 
-        $this->_data['authors'] = $people;
+        $this->_data['authors'] = $authors;
 
         return $this->_data['authors'];
     }
@@ -467,35 +462,28 @@ class Zend_Feed_Reader_Extension_Atom_Feed
      */
     protected function _getAuthor(DOMElement $element)
     {
-        $email = null;
-        $name  = null;
-        $uri   = null;
+        $author = array();
 
         $emailNode = $element->getElementsByTagName('email');
         $nameNode  = $element->getElementsByTagName('name');
         $uriNode   = $element->getElementsByTagName('uri');
-
-        if ($emailNode->length) {
-            $email = $emailNode->item(0)->nodeValue;
+        
+        if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) {
+            $author['email'] = $emailNode->item(0)->nodeValue;
         }
 
-        if ($nameNode->length) {
-            $name = $nameNode->item(0)->nodeValue;
+        if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) {
+            $author['name'] = $nameNode->item(0)->nodeValue;
         }
 
-        if ($uriNode->length) {
-            $uri = $uriNode->item(0)->nodeValue;
+        if ($uriNode->length && strlen($uriNode->item(0)->nodeValue) > 0) {
+            $author['uri'] = $uriNode->item(0)->nodeValue;
         }
 
-        if (!empty($email)) {
-            return $email . (empty($name) ? '' : ' (' . $name . ')');
-        } else if (!empty($name)) {
-            return $name;
-        } else if (!empty($uri)) {
-            return $uri;
+        if (empty($author)) {
+            return null;
         }
-
-        return null;
+        return $author;
     }
 
     /**

+ 8 - 9
library/Zend/Feed/Reader/Extension/DublinCore/Entry.php

@@ -87,16 +87,15 @@ class Zend_Feed_Reader_Extension_DublinCore_Entry
 
         if ($list->length) {
             foreach ($list as $author) {
-                if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_20
-                    && preg_match("/\(([^\)]+)\)/", $author->nodeValue, $matches, PREG_OFFSET_CAPTURE)
-                ) {
-                    $authors[] = $matches[1][0];
-                } else {
-                    $authors[] = $author->nodeValue;
-                }
+                $authors[] = array(
+                    'name' => $author->nodeValue
+                );
             }
-
-            $authors = array_unique($authors);
+            $authors = new Zend_Feed_Reader_Collection_Author(
+                Zend_Feed_Reader::arrayUnique($authors)
+            );
+        } else {
+            $authors = null;
         }
 
         $this->_data['authors'] = $authors;

+ 17 - 7
library/Zend/Feed/Reader/Extension/DublinCore/Feed.php

@@ -30,6 +30,11 @@ require_once 'Zend/Feed/Reader/Extension/FeedAbstract.php';
 require_once 'Zend/Date.php';
 
 /**
+ * @see Zend_Feed_Reader_Collection_Author
+ */
+require_once 'Zend/Feed/Reader/Collection/Author.php';
+
+/**
  * @category   Zend
  * @package    Zend_Feed_Reader
  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
@@ -79,13 +84,18 @@ class Zend_Feed_Reader_Extension_DublinCore_Feed
                 $list = $this->_xpath->query('//dc10:publisher');
             }
         }
-
-        foreach ($list as $authorObj) {
-            $authors[] = $authorObj->nodeValue;
-        }
-
-        if (!empty($authors)) {
-            $authors = array_unique($authors);
+        
+        if ($list->length) {
+            foreach ($list as $author) {
+                $authors[] = array(
+                    'name' => $author->nodeValue
+                );
+            }
+            $authors = new Zend_Feed_Reader_Collection_Author(
+                Zend_Feed_Reader::arrayUnique($authors)
+            );
+        } else {
+            $authors = null;
         }
 
         $this->_data['authors'] = $authors;

+ 2 - 2
library/Zend/Feed/Reader/Feed/Atom.php

@@ -84,9 +84,9 @@ class Zend_Feed_Reader_Feed_Atom extends Zend_Feed_Reader_FeedAbstract
             return $this->_data['authors'];
         }
 
-        $people = $this->getExtension('Atom')->getAuthors();
+        $authors = $this->getExtension('Atom')->getAuthors();
 
-        $this->_data['authors'] = $people;
+        $this->_data['authors'] = $authors;
 
         return $this->_data['authors'];
     }

+ 43 - 17
library/Zend/Feed/Reader/Feed/Rss.php

@@ -40,6 +40,11 @@ require_once 'Zend/Feed/Reader/Extension/DublinCore/Feed.php';
 require_once 'Zend/Date.php';
 
 /**
+ * @see Zend_Feed_Reader_Collection_Author
+ */
+require_once 'Zend/Feed/Reader/Collection/Author.php';
+
+/**
  * @category   Zend
  * @package    Zend_Feed_Reader
  * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
@@ -100,33 +105,54 @@ class Zend_Feed_Reader_Feed_Rss extends Zend_Feed_Reader_FeedAbstract
         if (array_key_exists('authors', $this->_data)) {
             return $this->_data['authors'];
         }
-
+        
         $authors = array();
-
-        if (empty($authors)) {
-            $authors = $this->getExtension('DublinCore')->getAuthors();
-        }
-
-        if (empty($authors)) {
-            if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
-                $list = $this->_xpath->query('//author');
-            } else {
-                $list = $this->_xpath->query('//rss:author');
+        $authors_dc = $this->getExtension('DublinCore')->getAuthors();
+        if (!empty($authors_dc)) {
+            foreach ($authors_dc as $author) {
+                $authors[] = array(
+                    'name' => $author['name']
+                );
             }
+        }
 
-            foreach ($list as $authorObj) {
-                $authors[] = $authorObj->nodeValue;
+        /**
+         * Technically RSS doesn't specific author element use at the feed level
+         * but it's supported on a "just in case" basis.
+         */
+        if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10
+        && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) {
+            $list = $this->_xpath->query('//author');
+        } else {
+            $list = $this->_xpath->query('//rss:author');
+        }
+        if ($list->length) {
+            foreach ($list as $author) {
+                $string = trim($author->nodeValue);
+                $email = null;
+                $name = null;
+                $data = array();
+                // Pretty rough parsing - but it's a catchall
+                if (preg_match("/^.*@[^ ]*/", $string, $matches)) {
+                    $data['email'] = trim($matches[0]);
+                    if (preg_match("/\((.*)\)$/", $string, $matches)) {
+                        $data['name'] = $matches[1];
+                    }
+                    $authors[] = $data;
+                } 
             }
         }
 
-        if (empty($authors)) {
+        if (count($authors) == 0) {
             $authors = $this->getExtension('Atom')->getAuthors();
+        } else {
+            $authors = new Zend_Feed_Reader_Collection_Author(
+                Zend_Feed_Reader::arrayUnique($authors)
+            );
         }
 
-        if (empty($authors)) {
+        if (count($authors) == 0) {
             $authors = null;
-        } else {
-            $authors = array_unique($authors);
         }
 
         $this->_data['authors'] = $authors;

+ 8 - 7
tests/Zend/Feed/Reader/Entry/AtomStandaloneEntryTest.php

@@ -163,14 +163,15 @@ class Zend_Feed_Reader_Entry_AtomStandaloneEntryTest extends PHPUnit_Framework_T
         );
 
         $authors = array(
-            0 => 'joe@example.com (Joe Bloggs)',
-            1 => 'Joe Bloggs',
-            3 => 'joe@example.com',
-            4 => 'http://www.example.com',
-            6 => 'jane@example.com (Jane Bloggs)'
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs'),
+            array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
+            array('uri'=>'http://www.example.com'),
+            array('email'=>'joe@example.com')
         );
 
-        $this->assertEquals($authors, $entry->getAuthors());
+        $this->assertEquals($authors, (array) $entry->getAuthors());
     }
 
     /**
@@ -182,7 +183,7 @@ class Zend_Feed_Reader_Entry_AtomStandaloneEntryTest extends PHPUnit_Framework_T
         $entry = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath . '/author/atom10.xml')
         );
-        $this->assertEquals('joe@example.com (Joe Bloggs)', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $entry->getAuthor());
     }
 
     /**

+ 16 - 14
tests/Zend/Feed/Reader/Entry/AtomTest.php

@@ -195,15 +195,16 @@ class Zend_Feed_Reader_Entry_AtomTest extends PHPUnit_Framework_TestCase
         );
 
         $authors = array(
-            0 => 'joe@example.com (Joe Bloggs)',
-            1 => 'Joe Bloggs',
-            3 => 'joe@example.com',
-            4 => 'http://www.example.com',
-            6 => 'jane@example.com (Jane Bloggs)'
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs'),
+            array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
+            array('uri'=>'http://www.example.com'),
+            array('email'=>'joe@example.com')
         );
 
         $entry = $feed->current();
-        $this->assertEquals($authors, $entry->getAuthors());
+        $this->assertEquals($authors, (array) $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromAtom10()
@@ -213,15 +214,16 @@ class Zend_Feed_Reader_Entry_AtomTest extends PHPUnit_Framework_TestCase
         );
 
         $authors = array(
-            0 => 'joe@example.com (Joe Bloggs)',
-            1 => 'Joe Bloggs',
-            3 => 'joe@example.com',
-            4 => 'http://www.example.com',
-            6 => 'jane@example.com (Jane Bloggs)'
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs'),
+            array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
+            array('uri'=>'http://www.example.com'),
+            array('email'=>'joe@example.com')
         );
 
         $entry = $feed->current();
-        $this->assertEquals($authors, $entry->getAuthors());
+        $this->assertEquals($authors, (array) $entry->getAuthors());
     }
 
     /**
@@ -233,7 +235,7 @@ class Zend_Feed_Reader_Entry_AtomTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath . '/author/plain/atom03.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('joe@example.com (Joe Bloggs)', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromAtom10()
@@ -242,7 +244,7 @@ class Zend_Feed_Reader_Entry_AtomTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath . '/author/plain/atom10.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('joe@example.com (Joe Bloggs)', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $entry->getAuthor());
     }
 
     /**

+ 89 - 43
tests/Zend/Feed/Reader/Entry/RssTest.php

@@ -707,7 +707,11 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss094()
@@ -716,7 +720,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss094.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss093()
@@ -725,7 +729,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss093.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss092()
@@ -734,7 +738,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss092.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss091()
@@ -743,7 +747,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss091.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss10()
@@ -752,7 +756,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss10.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss090()
@@ -761,7 +765,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss090.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     // DC 1.0
@@ -772,7 +776,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss094_Dc10()
@@ -781,7 +788,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss093_Dc10()
@@ -790,7 +800,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss092_Dc10()
@@ -799,7 +812,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss091_Dc10()
@@ -808,7 +824,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss10_Dc10()
@@ -817,7 +836,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss090_Dc10()
@@ -826,7 +848,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     // DC 1.1
@@ -837,7 +862,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss094_Dc11()
@@ -846,7 +874,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss093_Dc11()
@@ -855,7 +886,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss092_Dc11()
@@ -864,7 +898,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss091_Dc11()
@@ -873,7 +910,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss10_Dc11()
@@ -882,7 +922,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     public function testGetsAuthorsFromRss090_Dc11()
@@ -891,7 +934,10 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $entry->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $entry->getAuthors()->getValues());
     }
 
     // Missing Author
@@ -902,7 +948,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/none/rss20.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss094_None()
@@ -911,7 +957,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/none/rss094.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss093_None()
@@ -920,7 +966,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/none/rss093.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss092_None()
@@ -929,7 +975,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/none/rss092.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss091_None()
@@ -938,7 +984,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/none/rss091.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss10_None()
@@ -947,7 +993,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/none/rss10.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
     public function testGetsAuthorsFromRss090_None()
@@ -956,7 +1002,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/none/rss090.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals(array(), $entry->getAuthors());
+        $this->assertEquals(null, $entry->getAuthors());
     }
 
 
@@ -969,7 +1015,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromRss094()
@@ -1034,7 +1080,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromRss094_Dc10()
@@ -1043,7 +1089,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Jane Bloggs', $entry->getAuthor(1));
+        $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
     }
 
     public function testGetsAuthorFromRss093_Dc10()
@@ -1052,7 +1098,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromRss092_Dc10()
@@ -1061,7 +1107,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Jane Bloggs', $entry->getAuthor(1));
+        $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
     }
 
     public function testGetsAuthorFromRss091_Dc10()
@@ -1070,7 +1116,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromRss10_Dc10()
@@ -1079,7 +1125,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Jane Bloggs', $entry->getAuthor(1));
+        $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
     }
 
     public function testGetsAuthorFromRss090_Dc10()
@@ -1088,7 +1134,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
     }
 
     // DC 1.1
@@ -1099,7 +1145,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Jane Bloggs', $entry->getAuthor(1));
+        $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
     }
 
     public function testGetsAuthorFromRss094_Dc11()
@@ -1108,7 +1154,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromRss093_Dc11()
@@ -1117,7 +1163,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Jane Bloggs', $entry->getAuthor(1));
+        $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
     }
 
     public function testGetsAuthorFromRss092_Dc11()
@@ -1126,7 +1172,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromRss091_Dc11()
@@ -1135,7 +1181,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Jane Bloggs', $entry->getAuthor(1));
+        $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
     }
 
     public function testGetsAuthorFromRss10_Dc11()
@@ -1144,7 +1190,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Joe Bloggs', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $entry->getAuthor());
     }
 
     public function testGetsAuthorFromRss090_Dc11()
@@ -1153,7 +1199,7 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
         );
         $entry = $feed->current();
-        $this->assertEquals('Jane Bloggs', $entry->getAuthor(1));
+        $this->assertEquals(array('name'=>'Jane Bloggs'), $entry->getAuthor(1));
     }
 
     // Missing Id

+ 8 - 7
tests/Zend/Feed/Reader/Feed/AtomSourceTest.php

@@ -128,14 +128,15 @@ class Zend_Feed_Reader_Feed_AtomSourceTest extends PHPUnit_Framework_TestCase
         $source = $feed->current()->getSource();
 
         $authors = array(
-            0 => 'joe@example.com (Joe Bloggs)',
-            1 => 'Joe Bloggs',
-            3 => 'joe@example.com',
-            4 => 'http://www.example.com',
-            6 => 'jane@example.com (Jane Bloggs)'
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs'),
+            array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
+            array('uri'=>'http://www.example.com'),
+            array('email'=>'joe@example.com')
         );
 
-        $this->assertEquals($authors, $source->getAuthors());
+        $this->assertEquals($authors, (array) $source->getAuthors());
     }
 
     /**
@@ -149,7 +150,7 @@ class Zend_Feed_Reader_Feed_AtomSourceTest extends PHPUnit_Framework_TestCase
         );
         $source = $feed->current()->getSource();
 
-        $this->assertEquals('joe@example.com (Joe Bloggs)', $source->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $feed->getAuthor());
     }
 
     /**

+ 16 - 14
tests/Zend/Feed/Reader/Feed/AtomTest.php

@@ -123,14 +123,15 @@ class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit_Framework_TestCase
         );
 
         $authors = array(
-            0 => 'joe@example.com (Joe Bloggs)',
-            1 => 'Joe Bloggs',
-            3 => 'joe@example.com',
-            4 => 'http://www.example.com',
-            6 => 'jane@example.com (Jane Bloggs)'
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs'),
+            array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
+            array('uri'=>'http://www.example.com'),
+            array('email'=>'joe@example.com')
         );
 
-        $this->assertEquals($authors, $feed->getAuthors());
+        $this->assertEquals($authors, (array) $feed->getAuthors());
     }
 
     public function testGetsAuthorArrayFromAtom10()
@@ -140,14 +141,15 @@ class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit_Framework_TestCase
         );
 
         $authors = array(
-            0 => 'joe@example.com (Joe Bloggs)',
-            1 => 'Joe Bloggs',
-            3 => 'joe@example.com',
-            4 => 'http://www.example.com',
-            6 => 'jane@example.com (Jane Bloggs)'
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs','uri'=>'http://www.example.com'),
+            array('name'=>'Joe Bloggs'),
+            array('email'=>'joe@example.com','uri'=>'http://www.example.com'),
+            array('uri'=>'http://www.example.com'),
+            array('email'=>'joe@example.com')
         );
 
-        $this->assertEquals($authors, $feed->getAuthors());
+        $this->assertEquals($authors, (array) $feed->getAuthors());
     }
 
     /**
@@ -159,7 +161,7 @@ class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/atom03.xml')
         );
 
-        $this->assertEquals('joe@example.com (Joe Bloggs)', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromAtom10()
@@ -168,7 +170,7 @@ class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit_Framework_TestCase
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10.xml')
         );
 
-        $this->assertEquals('joe@example.com (Joe Bloggs)', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com','uri'=>'http://www.example.com'), $feed->getAuthor());
     }
 
     /**

+ 140 - 49
tests/Zend/Feed/Reader/Feed/RssTest.php

@@ -411,7 +411,11 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss094()
@@ -419,7 +423,11 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss094.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss093()
@@ -427,7 +435,11 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss093.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss092()
@@ -435,7 +447,11 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss092.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss091()
@@ -443,7 +459,11 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss091.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss10()
@@ -451,7 +471,11 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss10.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss090()
@@ -459,7 +483,11 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss090.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('email'=>'joe@example.com','name'=>'Joe Bloggs'),
+            array('email'=>'jane@example.com','name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     // DC 1.0
@@ -469,7 +497,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss094_Dc10()
@@ -477,7 +508,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss093_Dc10()
@@ -485,7 +519,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss092_Dc10()
@@ -493,7 +530,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss091_Dc10()
@@ -501,7 +541,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss10_Dc10()
@@ -509,7 +552,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss090_Dc10()
@@ -517,7 +563,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());;
     }
 
     // DC 1.1
@@ -527,7 +576,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss094_Dc11()
@@ -535,7 +587,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss093_Dc11()
@@ -543,7 +598,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss092_Dc11()
@@ -551,7 +609,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss091_Dc11()
@@ -559,7 +620,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss10_Dc11()
@@ -567,7 +631,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss090_Dc11()
@@ -575,7 +642,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     // Atom 1.0
@@ -585,7 +655,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss20.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss094_Atom10()
@@ -593,7 +666,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss094.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss093_Atom10()
@@ -601,7 +677,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss093.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss092_Atom10()
@@ -609,7 +688,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss092.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss091_Atom10()
@@ -617,7 +699,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss091.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss10_Atom10()
@@ -625,7 +710,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss10.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     public function testGetsAuthorArrayFromRss090_Atom10()
@@ -633,7 +721,10 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/atom10/rss090.xml')
         );
-        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'Joe Bloggs'), array('name'=>'Jane Bloggs')
+        ), (array) $feed->getAuthors());
+        $this->assertEquals(array('Joe Bloggs','Jane Bloggs'), $feed->getAuthors()->getValues());
     }
 
     // Missing Authors
@@ -702,7 +793,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss20.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss094()
@@ -710,7 +801,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss094.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss093()
@@ -718,7 +809,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss093.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss092()
@@ -726,7 +817,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss092.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss091()
@@ -734,7 +825,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss091.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss10()
@@ -742,7 +833,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss10.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss090()
@@ -750,7 +841,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/rss090.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs','email'=>'joe@example.com'), $feed->getAuthor());
     }
 
     // DC 1.0
@@ -760,7 +851,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss20.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss094_Dc10()
@@ -768,7 +859,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss094.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss093_Dc10()
@@ -776,7 +867,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss093.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss092_Dc10()
@@ -784,7 +875,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss092.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss091_Dc10()
@@ -792,7 +883,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss091.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss10_Dc10()
@@ -800,7 +891,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss10.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss090_Dc10()
@@ -808,7 +899,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc10/rss090.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     // DC 1.1
@@ -818,7 +909,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss20.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss094_Dc11()
@@ -826,7 +917,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss094.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss093_Dc11()
@@ -834,7 +925,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss093.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss092_Dc11()
@@ -842,7 +933,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss092.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss091_Dc11()
@@ -850,7 +941,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss091.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss10_Dc11()
@@ -858,7 +949,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss10.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     public function testGetsSingleAuthorFromRss090_Dc11()
@@ -866,7 +957,7 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath.'/author/plain/dc11/rss090.xml')
         );
-        $this->assertEquals('Joe Bloggs', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'Joe Bloggs'), $feed->getAuthor());
     }
 
     // Missing Author

+ 3 - 3
tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss090.xml

@@ -4,8 +4,8 @@
     xmlns="http://my.netscape.com/rdf/simple/0.9/">
     <channel>
         <item>
-            <author>Joe Bloggs</author>
-            <author>Jane Bloggs</author>
+            <author>joe@example.com (Joe Bloggs)</author>
+            <author>jane@example.com (Jane Bloggs)</author>
         </item>
     </channel>
-</rdf:RDF>
+</rdf:RDF>

+ 3 - 3
tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss091.xml

@@ -2,8 +2,8 @@
 <rss version="0.91">
     <channel>
         <item>
-            <author>Joe Bloggs</author>
-            <author>Jane Bloggs</author>
+            <author>joe@example.com (Joe Bloggs)</author>
+            <author>jane@example.com (Jane Bloggs)</author>
         </item>
     </channel>
-</rss>
+</rss>

+ 3 - 3
tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss092.xml

@@ -2,8 +2,8 @@
 <rss version="0.92">
     <channel>
         <item>
-            <author>Joe Bloggs</author>
-            <author>Jane Bloggs</author>
+            <author>joe@example.com (Joe Bloggs)</author>
+            <author>jane@example.com (Jane Bloggs)</author>
         </item>
     </channel>
-</rss>
+</rss>

+ 3 - 3
tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss093.xml

@@ -2,8 +2,8 @@
 <rss version="0.93">
     <channel>
         <item>
-            <author>Joe Bloggs</author>
-            <author>Jane Bloggs</author>
+            <author>joe@example.com (Joe Bloggs)</author>
+            <author>jane@example.com (Jane Bloggs)</author>
         </item>
     </channel>
-</rss>
+</rss>

+ 3 - 3
tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss094.xml

@@ -2,8 +2,8 @@
 <rss version="0.94">
     <channel>
         <item>
-            <author>Joe Bloggs</author>
-            <author>Jane Bloggs</author>
+            <author>joe@example.com (Joe Bloggs)</author>
+            <author>jane@example.com (Jane Bloggs)</author>
         </item>
     </channel>
-</rss>
+</rss>

+ 3 - 3
tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss10.xml

@@ -4,8 +4,8 @@
     xmlns="http://purl.org/rss/1.0/">
     <channel>
         <item>
-            <author>Joe Bloggs</author>
-            <author>Jane Bloggs</author>
+            <author>joe@example.com (Joe Bloggs)</author>
+            <author>jane@example.com (Jane Bloggs)</author>
         </item>
     </channel>
-</rdf:RDF>
+</rdf:RDF>

+ 3 - 3
tests/Zend/Feed/Reader/Feed/_files/Rss/author/plain/rss20.xml

@@ -2,8 +2,8 @@
 <rss version="2.0">
     <channel>
         <item>
-            <author>Joe Bloggs</author>
-            <author>Jane Bloggs</author>
+            <author>joe@example.com (Joe Bloggs)</author>
+            <author>jane@example.com (Jane Bloggs)</author>
         </item>
     </channel>
-</rss>
+</rss>

+ 4 - 4
tests/Zend/Feed/Reader/Integration/H-OnlineComAtom10Test.php

@@ -68,7 +68,7 @@ class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit_Framewor
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals(array('The H'), $feed->getAuthors());
+        $this->assertEquals(array(array('name'=>'The H')), (array) $feed->getAuthors());
     }
 
     public function testGetsSingleAuthor()
@@ -76,7 +76,7 @@ class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit_Framewor
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals('The H', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'The H'), $feed->getAuthor());
     }
 
     public function testGetsCopyright()
@@ -155,7 +155,7 @@ class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit_Framewor
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals(array('The H'), $entry->getAuthors());
+        $this->assertEquals(array(array('name'=>'The H')), (array) $entry->getAuthors());
     }
 
     public function testGetsEntrySingleAuthor()
@@ -164,7 +164,7 @@ class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit_Framewor
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals('The H', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'The H'), $entry->getAuthor());
     }
 
     public function testGetsEntryDescription()

+ 4 - 4
tests/Zend/Feed/Reader/Integration/LautDeRdfTest.php

@@ -72,7 +72,7 @@ class Zend_Feed_Reader_Integration_LautDeRdfTest extends PHPUnit_Framework_TestC
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals(array('laut.de'), $feed->getAuthors());
+        $this->assertEquals(array(array('name'=>'laut.de')), (array) $feed->getAuthors());
     }
 
     public function testGetsSingleAuthor()
@@ -80,7 +80,7 @@ class Zend_Feed_Reader_Integration_LautDeRdfTest extends PHPUnit_Framework_TestC
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals('laut.de', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'laut.de'), $feed->getAuthor());
     }
 
     public function testGetsCopyright()
@@ -153,7 +153,7 @@ class Zend_Feed_Reader_Integration_LautDeRdfTest extends PHPUnit_Framework_TestC
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals(array('laut.de'), $entry->getAuthors());
+        $this->assertEquals(array(array('name'=>'laut.de')), (array) $entry->getAuthors());
     }
 
     public function testGetsEntrySingleAuthor()
@@ -162,7 +162,7 @@ class Zend_Feed_Reader_Integration_LautDeRdfTest extends PHPUnit_Framework_TestC
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals('laut.de', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'laut.de'), $entry->getAuthor());
     }
 
     // Technically, the next two tests should not pass. However the source feed has an encoding

+ 6 - 4
tests/Zend/Feed/Reader/Integration/WordpressAtom10Test.php

@@ -68,7 +68,9 @@ class Zend_Feed_Reader_Integration_WordpressAtom10Test extends PHPUnit_Framework
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals(array('norm2782'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'norm2782','uri'=>'http://www.norm2782.com')
+        ), (array) $feed->getAuthors());
     }
 
     public function testGetsSingleAuthor()
@@ -76,7 +78,7 @@ class Zend_Feed_Reader_Integration_WordpressAtom10Test extends PHPUnit_Framework
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals('norm2782', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'norm2782','uri'=>'http://www.norm2782.com'), $feed->getAuthor());
     }
 
     public function testGetsCopyright()
@@ -159,7 +161,7 @@ class Zend_Feed_Reader_Integration_WordpressAtom10Test extends PHPUnit_Framework
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals(array('norm2782'), $entry->getAuthors());
+        $this->assertEquals(array(array('name'=>'norm2782','uri'=>'http://www.norm2782.com')), (array) $entry->getAuthors());
     }
 
     public function testGetsEntrySingleAuthor()
@@ -168,7 +170,7 @@ class Zend_Feed_Reader_Integration_WordpressAtom10Test extends PHPUnit_Framework
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals('norm2782', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'norm2782','uri'=>'http://www.norm2782.com'), $entry->getAuthor());
     }
 
     public function testGetsEntryDescription()

+ 6 - 4
tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php

@@ -60,7 +60,9 @@ class Zend_Feed_Reader_Integration_WordpressRss2DcAtomTest extends PHPUnit_Frame
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals(array('norm2782'), $feed->getAuthors());
+        $this->assertEquals(array(
+            array('name'=>'norm2782')
+        ), (array) $feed->getAuthors());
     }
 
     public function testGetsSingleAuthor()
@@ -68,7 +70,7 @@ class Zend_Feed_Reader_Integration_WordpressRss2DcAtomTest extends PHPUnit_Frame
         $feed = Zend_Feed_Reader::importString(
             file_get_contents($this->_feedSamplePath)
         );
-        $this->assertEquals('norm2782', $feed->getAuthor());
+        $this->assertEquals(array('name'=>'norm2782'), $feed->getAuthor());
     }
 
     public function testGetsCopyright()
@@ -151,7 +153,7 @@ class Zend_Feed_Reader_Integration_WordpressRss2DcAtomTest extends PHPUnit_Frame
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals(array('norm2782'), $entry->getAuthors());
+        $this->assertEquals(array(array('name'=>'norm2782')), (array) $entry->getAuthors());
     }
 
     public function testGetsEntrySingleAuthor()
@@ -160,7 +162,7 @@ class Zend_Feed_Reader_Integration_WordpressRss2DcAtomTest extends PHPUnit_Frame
             file_get_contents($this->_feedSamplePath)
         );
         $entry = $feed->current();
-        $this->assertEquals('norm2782', $entry->getAuthor());
+        $this->assertEquals(array('name'=>'norm2782'), $entry->getAuthor());
     }
 
     public function testGetsEntryDescription()