summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2021-01-08 22:47:44 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-01-12 13:29:08 +0100
commite5d56f2c2e4542fca98194620a30605aa9e14437 (patch)
tree26e5a4a4a77babe3903579369dd203cf02c9fc39
parentf7b43501afa339dd11abca62c5e8eaa9a2c67d4e (diff)
Fix getUnreadOrStarredType
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
-rw-r--r--lib/Service/ItemService.php4
-rw-r--r--tests/Unit/Service/ItemServiceTest.php6
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/Service/ItemService.php b/lib/Service/ItemService.php
index 882e875c5..58533cb7d 100644
--- a/lib/Service/ItemService.php
+++ b/lib/Service/ItemService.php
@@ -329,9 +329,9 @@ class ItemService extends Service
/**
* @param string $userId from which user the items should be taken
- * @return int of items which are starred or unread
+ * @return array of items which are starred or unread
*/
- public function getUnreadOrStarred($userId)
+ public function getUnreadOrStarred($userId): array
{
return $this->oldItemMapper->findAllUnreadOrStarred($userId);
}
diff --git a/tests/Unit/Service/ItemServiceTest.php b/tests/Unit/Service/ItemServiceTest.php
index 89328b6ec..1ab9a7b25 100644
--- a/tests/Unit/Service/ItemServiceTest.php
+++ b/tests/Unit/Service/ItemServiceTest.php
@@ -506,16 +506,14 @@ class ItemServiceTest extends TestCase
public function testGetUnreadOrStarred()
{
- $star = 18;
-
$this->oldItemMapper->expects($this->once())
->method('findAllUnreadOrStarred')
->with($this->equalTo('jack'))
- ->will($this->returnValue($star));
+ ->will($this->returnValue([]));
$result = $this->itemService->getUnreadOrStarred('jack');
- $this->assertEquals($star, $result);
+ $this->assertEquals([], $result);
}