summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-19 11:42:27 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-19 11:42:40 +0200
commit3e9a13efc9d95aac61191481fc9b90cfe3ca6e41 (patch)
treeff252c7c2a378de265831a144b9e407d4d23d276 /tests/unit
parentd328d409986a4e8c504fe65c3bf7c5b445b21814 (diff)
added skeletons for google reader import
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/controller/FeedControllerTest.php31
-rw-r--r--tests/unit/utility/FeedFetcherTest.php4
2 files changed, 33 insertions, 2 deletions
diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php
index 428ecc7d4..b41977962 100644
--- a/tests/unit/controller/FeedControllerTest.php
+++ b/tests/unit/controller/FeedControllerTest.php
@@ -112,6 +112,10 @@ class FeedControllerTest extends ControllerTestUtility {
}
+ public function testImportGoogleReaderAnnotations(){
+ $this->assertFeedControllerAnnotations('importGoogleReader');
+ }
+
public function testFeeds(){
$result = array(
'feeds' => array(
@@ -381,4 +385,31 @@ class FeedControllerTest extends ControllerTestUtility {
$this->assertTrue($response instanceof JSONResponse);
}
+
+ public function testImportGoogleReader() {
+ $feed = new Feed();
+
+ $post = array(
+ 'json' => 'the json'
+ );
+ $expected = array(
+ 'feeds' => array($feed)
+ );
+ $this->controller = $this->getPostController($post);
+
+ $this->api->expects($this->once())
+ ->method('getUserId')
+ ->will($this->returnValue($this->user));
+ $this->feedBusinessLayer->expects($this->once())
+ ->method('importGoogleReaderJSON')
+ ->with($this->equalTo($post['json']),
+ $this->equalTo($this->user))
+ ->will($this->returnValue($feed));
+
+ $response = $this->controller->importGoogleReader();
+
+ $this->assertEquals($expected, $response->getParams());
+ $this->assertTrue($response instanceof JSONResponse);
+ }
+
} \ No newline at end of file
diff --git a/tests/unit/utility/FeedFetcherTest.php b/tests/unit/utility/FeedFetcherTest.php
index bb027a778..e4fea6b25 100644
--- a/tests/unit/utility/FeedFetcherTest.php
+++ b/tests/unit/utility/FeedFetcherTest.php
@@ -101,7 +101,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
$this->guid = 'hey guid here';
$this->body = 'let the bodies hit the floor';
$this->pub = 23111;
- $this->author = 'boogieman';
+ $this->author = 'boogieman&lte;';
$this->enclosureLink = 'http://enclosure.you';
$this->feedTitle = '&lte;its a title';
@@ -184,7 +184,7 @@ class FeedFetcherTest extends \OCA\AppFramework\Utility\TestUtility {
->method('get_name')
->will($this->returnValue($this->author));
$this->expectItem('get_author', $mock);
- $item->setAuthor($this->author);
+ $item->setAuthor(html_entity_decode($this->author));
}
if($enclosureType === 'audio/ogg') {