summaryrefslogtreecommitdiffstats
path: root/tests/unit/controller/FeedControllerTest.php
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/controller/FeedControllerTest.php
parentd328d409986a4e8c504fe65c3bf7c5b445b21814 (diff)
added skeletons for google reader import
Diffstat (limited to 'tests/unit/controller/FeedControllerTest.php')
-rw-r--r--tests/unit/controller/FeedControllerTest.php31
1 files changed, 31 insertions, 0 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