diff options
author | Davide Saurino <davide.saurino@alcacoop.it> | 2014-03-13 00:00:03 +0100 |
---|---|---|
committer | Davide Saurino <davide.saurino@alcacoop.it> | 2014-03-13 00:00:03 +0100 |
commit | d67b77ac255974d2298bd858b636767e490a4e41 (patch) | |
tree | 9b02fea869e9328b3c5a48ea38de262c67143943 /tests/unit/api/FeedAPITest.php | |
parent | c179198a0408f6d3edf27d5e3f8ab006da32bf0c (diff) |
Test for renaming feed API feature
Diffstat (limited to 'tests/unit/api/FeedAPITest.php')
-rw-r--r-- | tests/unit/api/FeedAPITest.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/unit/api/FeedAPITest.php b/tests/unit/api/FeedAPITest.php index e3b5b5587..6b2187657 100644 --- a/tests/unit/api/FeedAPITest.php +++ b/tests/unit/api/FeedAPITest.php @@ -437,6 +437,43 @@ class FeedAPITest extends ControllerTestUtility { } + public function testRename() { + $feedId = 3; + $feedTitle = 'test'; + + $request = new Request(array( + 'urlParams' => array( + 'feedId' => $feedId + ), + 'params' => array( + 'feedTitle' => $feedTitle + ) + )); + $this->feedAPI = new FeedAPI( + $this->api, + $request, + $this->folderBusinessLayer, + $this->feedBusinessLayer, + $this->itemBusinessLayer + ); + + $this->api->expects($this->once()) + ->method('getUserId') + ->will($this->returnValue($this->user)); + $this->feedBusinessLayer->expects($this->once()) + ->method('rename') + ->with( + $this->equalTo($feedId), + $this->equalTo($feedTitle), + $this->equalTo($this->user)); + + $response = $this->feedAPI->rename(); + + $this->assertEmpty($response->getData()); + $this->assertEquals(Http::STATUS_OK, $response->getStatus()); + } + + public function testMoveDoesNotExist() { $this->api->expects($this->once()) ->method('getUserId') |