summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWENDLING NICOLAS <nicolas.wendling2@etu.unistra.fr>2021-02-28 21:17:18 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 22:31:21 +0200
commit890b8fa1df48a0ee55e5b8fe06f81e387afb7ee8 (patch)
treef831765382b4d876bda3abd495949ce034ae7ea6 /tests
parent2c59331316eabe318e7a44c9451fe43cf4152a70 (diff)
✅ Fix FeedControllerTest tests
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Controller/FeedControllerTest.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/tests/Unit/Controller/FeedControllerTest.php b/tests/Unit/Controller/FeedControllerTest.php
index 5713cb932..2ea13b1ec 100644
--- a/tests/Unit/Controller/FeedControllerTest.php
+++ b/tests/Unit/Controller/FeedControllerTest.php
@@ -138,7 +138,7 @@ class FeedControllerTest extends TestCase
['a feed'],
],
'starred' => 4,
- // 'shared' => 3 // TODO: uncomment when implemented
+ 'shared' => 3
];
$this->feedService->expects($this->once())
->method('findAllForUser')
@@ -152,11 +152,10 @@ class FeedControllerTest extends TestCase
->method('starred')
->with($this->uid)
->will($this->returnValue([1, 2, 3, 4]));
- // TODO: uncomment when implemented
- // $this->itemService->expects($this->once())
- // ->method('shared')
- // ->with($this->equalTo($this->user))
- // ->will($this->returnValue($result['shared']));
+ $this->itemService->expects($this->once())
+ ->method('sharedWithUser')
+ ->with($this->equalTo($this->uid))
+ ->will($this->returnValue([0, 1, 2]));
$response = $this->class->index();
@@ -171,7 +170,7 @@ class FeedControllerTest extends TestCase
['a feed'],
],
'starred' => 2,
- // 'shared' => 3, // TODO: uncomment when implemented
+ 'shared' => 3,
'newestItemId' => 5
];
$this->feedService->expects($this->once())
@@ -186,11 +185,10 @@ class FeedControllerTest extends TestCase
->method('starred')
->with($this->uid)
->will($this->returnValue([1, 2]));
- // TODO: uncomment when implemented
- // $this->itemService->expects($this->once())
- // ->method('shared')
- // ->with($this->equalTo($this->user))
- // ->will($this->returnValue($result['shared']));
+ $this->itemService->expects($this->once())
+ ->method('sharedWithUser')
+ ->with($this->equalTo($this->uid))
+ ->will($this->returnValue([4, 5, 6]));
$response = $this->class->index();