summaryrefslogtreecommitdiffstats
path: root/tests/unit/controller/FeedControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/controller/FeedControllerTest.php')
-rw-r--r--tests/unit/controller/FeedControllerTest.php46
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']);