diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-22 10:14:35 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-22 10:14:35 +0200 |
commit | 5f71477e1a8ac9704e5c580a5bb5d8d820a43a19 (patch) | |
tree | 256d6f2c37c861e11e21c4244bdad6d15ae77e3f /tests | |
parent | 9733fead9df17f510978762829bc70af0ae433c1 (diff) |
added unittest for author mail
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/utility/FeedFetcherTest.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/unit/utility/FeedFetcherTest.php b/tests/unit/utility/FeedFetcherTest.php index 3d1f2a340..ba2e5c191 100644 --- a/tests/unit/utility/FeedFetcherTest.php +++ b/tests/unit/utility/FeedFetcherTest.php @@ -50,6 +50,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility { private $pub; private $body; private $author; + private $authorMail; private $enclosureLink; // feed @@ -108,6 +109,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility { $this->feedLink = 'http://goatse'; $this->feedImage = '/an/image'; $this->webFavicon = 'http://anon.google.com'; + $this->authorMail = 'doe@joes.com'; } @@ -160,7 +162,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility { ->will($this->returnValue($return)); } - + private function createItem($author=false, $enclosureType=null) { $this->expectItem('get_permalink', $this->permalink); $this->expectItem('get_title', $this->title); @@ -185,6 +187,17 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility { ->will($this->returnValue($this->author)); $this->expectItem('get_author', $mock); $item->setAuthor(html_entity_decode($this->author)); + } else { + $mock = $this->getMock('author', array('get_name', 'get_email')); + $mock->expects($this->any()) + ->method('get_name') + ->will($this->returnValue('')); + $mock->expects($this->any()) + ->method('get_email') + ->will($this->returnValue($this->authorMail)); + + $this->expectItem('get_author', $mock); + $item->setAuthor(html_entity_decode($this->authorMail)); } if($enclosureType === 'audio/ogg') { |