From b250747c6681dca656b0761f70f53d0295d228d1 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sun, 1 Nov 2015 14:25:05 +0100 Subject: fix #882 --- tests/unit/controller/FeedControllerTest.php | 46 ++++++++-------------------- 1 file changed, 13 insertions(+), 33 deletions(-) (limited to 'tests/unit/controller') 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']); -- cgit v1.2.3