diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-11 20:31:58 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-09-12 01:00:32 +0200 |
commit | 00c6e040deec9c3998ab679dcb84fc46ae72d2ac (patch) | |
tree | 88a7ba6ab686b8a57d051f268e467773c8573059 /tests/unit/controller/FeedControllerTest.php | |
parent | 8ca8695fbe55599b1212de332853ebb85442b226 (diff) |
removed google importer on the serverside, add importer for articles
Diffstat (limited to 'tests/unit/controller/FeedControllerTest.php')
-rw-r--r-- | tests/unit/controller/FeedControllerTest.php | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index efbf90ea3..e3204517b 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -126,8 +126,8 @@ class FeedControllerTest extends ControllerTestUtility { } - public function testImportGoogleReaderAnnotations(){ - $this->assertFeedControllerAnnotations('importGoogleReader'); + public function testImportArticlesAnnotations(){ + $this->assertFeedControllerAnnotations('importArticles'); } public function testReadAnnotations(){ @@ -543,7 +543,7 @@ class FeedControllerTest extends ControllerTestUtility { } - public function testImportGoogleReader() { + public function testImportArticles() { $feed = new Feed(); $post = array( @@ -558,12 +558,37 @@ class FeedControllerTest extends ControllerTestUtility { ->method('getUserId') ->will($this->returnValue($this->user)); $this->feedBusinessLayer->expects($this->once()) - ->method('importGoogleReaderJSON') + ->method('importArticles') ->with($this->equalTo($post['json']), $this->equalTo($this->user)) ->will($this->returnValue($feed)); - $response = $this->controller->importGoogleReader(); + $response = $this->controller->importArticles(); + + $this->assertEquals($expected, $response->getParams()); + $this->assertTrue($response instanceof JSONResponse); + } + + + public function testImportArticlesCreatesNoAdditionalFeed() { + $feed = new Feed(); + + $post = array( + 'json' => 'the json' + ); + $expected = array(); + $this->controller = $this->getPostController($post); + + $this->api->expects($this->once()) + ->method('getUserId') + ->will($this->returnValue($this->user)); + $this->feedBusinessLayer->expects($this->once()) + ->method('importArticles') + ->with($this->equalTo($post['json']), + $this->equalTo($this->user)) + ->will($this->returnValue(null)); + + $response = $this->controller->importArticles(); $this->assertEquals($expected, $response->getParams()); $this->assertTrue($response instanceof JSONResponse); |