diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-01 14:25:05 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-01 14:25:42 +0100 |
commit | b250747c6681dca656b0761f70f53d0295d228d1 (patch) | |
tree | 906be611568fa4c958600697e4c93d825240fcd8 /tests/unit/controller | |
parent | 00c4eeb67905f481e4d50e81237873956120c7c5 (diff) |
fix #882
Diffstat (limited to 'tests/unit/controller')
-rw-r--r-- | tests/unit/controller/FeedControllerTest.php | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php index 80f2c805f..f821fde02 100644 --- a/tests/unit/controller/FeedControllerTest.php +++ b/tests/unit/controller/FeedControllerTest.php @@ -507,50 +507,30 @@ 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 testEnableFullText() { - $this->feedService->expects($this->once()) - ->method('enableFullText') - ->with($this->equalTo(4), - $this->equalTo(true), - $this->equalTo($this->user)) - ->will($this->returnValue(1)); - - $this->controller->enableFullText(4, true); - } - - - public function testPinned() { + public function testPatch() { + $expected = [ + 'pinned' => true, + 'fullTextEnabled' => true, + 'updateMode' => 1 + ]; $this->feedService->expects($this->once()) - ->method('setPinned') + ->method('patch') ->with($this->equalTo(4), - $this->equalTo(true), - $this->equalTo($this->user)) + $this->equalTo($this->user), + $this->equalTo($expected)) ->will($this->returnValue(1)); - $this->controller->pinned(4, true); + $this->controller->patch(4, true, true, 1); } - - public function testOrderingDoesNotExist(){ + public function testPatchDoesNotExist(){ $msg = 'hehe'; $this->feedService->expects($this->once()) - ->method('setOrdering') + ->method('patch') ->will($this->throwException(new ServiceNotFoundException($msg))); - $response = $this->controller->ordering(4, 2); + $response = $this->controller->patch(4, 2); $params = json_decode($response->render(), true); $this->assertEquals($msg, $params['message']); |