diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/businesslayer/FeedBusinessLayerTest.php | 22 | ||||
-rw-r--r-- | tests/unit/controller/FeedControllerTest.php | 24 |
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/unit/businesslayer/FeedBusinessLayerTest.php b/tests/unit/businesslayer/FeedBusinessLayerTest.php index 5e379525d..454a4966e 100644 --- a/tests/unit/businesslayer/FeedBusinessLayerTest.php +++ b/tests/unit/businesslayer/FeedBusinessLayerTest.php @@ -459,6 +459,28 @@ class FeedBusinessLayerTest extends \OCA\AppFramework\Utility\TestUtility { } + public function testRenameFeed(){ + $feedId = 3; + $feedTitle = "New Feed Title"; + $feed = new Feed(); + $feed->setTitle("Feed Title"); + $feed->setId($feedId); + + $this->feedMapper->expects($this->once()) + ->method('find') + ->with($this->equalTo($feedId), $this->equalTo($this->user)) + ->will($this->returnValue($feed)); + + $this->feedMapper->expects($this->once()) + ->method('update') + ->with($this->equalTo($feed)); + + $this->feedBusinessLayer->rename($feedId, $feedTitle, $this->user); + + $this->assertEquals($feedTitle, $feed->getTitle()); + } + + public function testImportArticles(){ $url = 'http://owncloud/nofeed'; diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index e3204517b..296f87b22 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -543,6 +543,30 @@ class FeedControllerTest extends ControllerTestUtility { } + public function testRename(){ + $post = array( + 'feedTitle' => "New Feed Title" + ); + $url = array( + 'feedId' => 4 + ); + $this->controller = $this->getPostController($post, $url); + + $this->api->expects($this->once()) + ->method('getUserId') + ->will($this->returnValue($this->user)); + $this->feedBusinessLayer->expects($this->once()) + ->method('rename') + ->with($this->equalTo($url['feedId']), + $this->equalTo($post['feedTitle']), + $this->equalTo($this->user)); + + $response = $this->controller->rename(); + + $this->assertTrue($response instanceof JSONResponse); + } + + public function testImportArticles() { $feed = new Feed(); |