diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-23 14:32:53 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-23 14:32:53 +0100 |
commit | df509a4b856472fa22fd6d43a212c9d21bd5b40f (patch) | |
tree | be8be7824bd4ba3ee687c6e57d1383929360e505 /tests/unit/controller/FeedControllerTest.php | |
parent | 5adeba1a560985173974c9ac98c624093055d669 (diff) |
fix #711
Diffstat (limited to 'tests/unit/controller/FeedControllerTest.php')
-rw-r--r-- | tests/unit/controller/FeedControllerTest.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index e7f19a2b8..813508cef 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -507,4 +507,31 @@ class FeedControllerTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($response->getStatus(), Http::STATUS_NOT_FOUND); } + + public function testOrdering() { + $this->feedService->expects($this->once()) + ->method('setOrdering') + ->with($this->equalTo(4), + $this->equalTo(2), + $this->equalTo($this->user)); + + $this->controller->ordering(4, 2); + } + + + public function testOrderingDoesNotExist(){ + $msg = 'hehe'; + + $this->feedService->expects($this->once()) + ->method('setOrdering') + ->will($this->throwException(new ServiceNotFoundException($msg))); + + $response = $this->controller->ordering(4, 2); + $params = json_decode($response->render(), true); + + $this->assertEquals($msg, $params['message']); + $this->assertEquals($response->getStatus(), Http::STATUS_NOT_FOUND); + } + + } |