summaryrefslogtreecommitdiffstats
path: root/tests/Unit/Controller
diff options
context:
space:
mode:
authorMarco Nassabain <marco.nassabain@hotmail.com>2021-02-07 22:26:49 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 22:31:21 +0200
commit4133e68c8ec87fd53dc424a4512758acbd4dc7d6 (patch)
treec34d2956b1d26412280bfea8f743d8199c76852b /tests/Unit/Controller
parent54aa8b527099edb409099335638382dbf754f36b (diff)
✅ Update tests to contain share data
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'tests/Unit/Controller')
-rw-r--r--tests/Unit/Controller/FeedControllerTest.php14
-rw-r--r--tests/Unit/Controller/ItemControllerTest.php27
2 files changed, 37 insertions, 4 deletions
diff --git a/tests/Unit/Controller/FeedControllerTest.php b/tests/Unit/Controller/FeedControllerTest.php
index fde821088..5713cb932 100644
--- a/tests/Unit/Controller/FeedControllerTest.php
+++ b/tests/Unit/Controller/FeedControllerTest.php
@@ -137,7 +137,8 @@ class FeedControllerTest extends TestCase
'feeds' => [
['a feed'],
],
- 'starred' => 4
+ 'starred' => 4,
+ // 'shared' => 3 // TODO: uncomment when implemented
];
$this->feedService->expects($this->once())
->method('findAllForUser')
@@ -151,6 +152,11 @@ 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']));
$response = $this->class->index();
@@ -165,6 +171,7 @@ class FeedControllerTest extends TestCase
['a feed'],
],
'starred' => 2,
+ // 'shared' => 3, // TODO: uncomment when implemented
'newestItemId' => 5
];
$this->feedService->expects($this->once())
@@ -179,6 +186,11 @@ 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']));
$response = $this->class->index();
diff --git a/tests/Unit/Controller/ItemControllerTest.php b/tests/Unit/Controller/ItemControllerTest.php
index c64cd9330..db3b5234b 100644
--- a/tests/Unit/Controller/ItemControllerTest.php
+++ b/tests/Unit/Controller/ItemControllerTest.php
@@ -231,7 +231,8 @@ class ItemControllerTest extends TestCase
'items' => [new Item()],
'feeds' => $feeds,
'newestItemId' => $this->newestItemId,
- 'starred' => 3
+ 'starred' => 3,
+ // 'shared' => 99 // TODO: uncomment when implement shared
];
$this->itemsApiExpects(2, ListType::FEED, '0');
@@ -251,6 +252,12 @@ class ItemControllerTest extends TestCase
->with('user')
->will($this->returnValue([1, 2, 3]));
+ // 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('findAllInFeedWithFilters')
->with('user', 2, 3, 0, false, false, [])
@@ -268,7 +275,8 @@ class ItemControllerTest extends TestCase
'items' => [new Item()],
'feeds' => $feeds,
'newestItemId' => $this->newestItemId,
- 'starred' => 3
+ 'starred' => 3,
+ // 'shared' => 99 // TODO: uncomment when implemented
];
$this->itemsApiExpects(2, ListType::FOLDER, '0');
@@ -288,6 +296,12 @@ class ItemControllerTest extends TestCase
->with('user')
->will($this->returnValue([1, 2, 3]));
+ // 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('findAllInFolderWithFilters')
->with('user', 2, 3, 0, false, false, [])
@@ -412,7 +426,8 @@ class ItemControllerTest extends TestCase
'items' => [new Item()],
'feeds' => $feeds,
'newestItemId' => $this->newestItemId,
- 'starred' => 3
+ 'starred' => 3,
+ // 'shared' => 99 // TODO: uncomment when implemented
];
$this->settings->expects($this->once())
@@ -435,6 +450,12 @@ class ItemControllerTest extends TestCase
->with('user')
->will($this->returnValue([1, 2, 3]));
+ // 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('findAllInFeedAfter')
->with('user', 2, 3, false)