summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarco Nassabain <marco.nassabain@hotmail.com>2021-02-28 23:06:53 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 22:31:21 +0200
commit8de50d44b6239dd54aef6080b4e5b9728cdbd9e7 (patch)
treeb801358a23b5206790035f6d2e0766c54608b48b /tests
parentee49a1d1cca114183aac79aa828fd153fbf0f89b (diff)
✅ ItemMapperPaginatedTest: update tests
Adapted folder/feed/item tests to take account for shared data - testFindAllItemsStarredSearch - testFindAllFeed - testFindAllFeedInverted - testFindAllFeedHideRead - testFindAllFeedSearch - testFindAllFolderIdNull - testFindAllFolderHideRead - testFindAllFolderHideReadInvertOrder - testFindAllFolderSearchId Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Db/ItemMapperPaginatedTest.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/Unit/Db/ItemMapperPaginatedTest.php b/tests/Unit/Db/ItemMapperPaginatedTest.php
index 3e506ffa1..f6703739a 100644
--- a/tests/Unit/Db/ItemMapperPaginatedTest.php
+++ b/tests/Unit/Db/ItemMapperPaginatedTest.php
@@ -427,7 +427,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
$this->builder->expects($this->exactly(6))
->method('andWhere')
->withConsecutive(
- ['feeds.user_id = :userId'],
+ ['(feeds.user_id = :userId AND items.shared_by = \'\') OR items.shared_with = :sharedWith'],
['feeds.deleted_at = 0'],
['items.search_index LIKE :term0'],
['items.search_index LIKE :term1'],
@@ -440,6 +440,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
->method('setParameter')
->withConsecutive(
['userId', 'jack'],
+ ['sharedWith', 'jack'],
['term0', '%key%'],
['term1', '%word%'],
['offset', 10],
@@ -511,6 +512,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
['feeds.deleted_at = 0'],
['feeds.user_id = :userId'],
['items.feed_id = :feedId'],
+ ['items.shared_by = \'\''],
['items.id < :offset']
)
->will($this->returnSelf());
@@ -655,6 +657,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
['feeds.deleted_at = 0'],
['feeds.user_id = :userId'],
['items.feed_id = :feedId'],
+ ['items.shared_by = \'\''],
['items.id > :offset']
)
->will($this->returnSelf());
@@ -726,6 +729,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
['feeds.deleted_at = 0'],
['feeds.user_id = :userId'],
['items.feed_id = :feedId'],
+ ['items.shared_by = \'\''],
['items.id < :offset'],
['items.unread = :unread']
)
@@ -803,6 +807,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
['feeds.deleted_at = 0'],
['feeds.user_id = :userId'],
['items.feed_id = :feedId'],
+ ['items.shared_by = \'\''],
['items.search_index LIKE :term0'],
['items.search_index LIKE :term1'],
['items.id < :offset']
@@ -895,6 +900,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
->withConsecutive(
['feeds.user_id = :userId'],
['feeds.deleted_at = 0'],
+ ['items.shared_by = \'\''],
['x IS NULL'],
['items.id < :offset']
)
@@ -1063,6 +1069,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
->withConsecutive(
['feeds.user_id = :userId'],
['feeds.deleted_at = 0'],
+ ['items.shared_by = \'\''],
['x IS NULL'],
['items.id < :offset'],
['items.unread = :unread']
@@ -1149,6 +1156,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
->withConsecutive(
['feeds.user_id = :userId'],
['feeds.deleted_at = 0'],
+ ['items.shared_by = \'\''],
['x IS NULL'],
['items.id > :offset'],
['items.unread = :unread']
@@ -1238,6 +1246,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility
->withConsecutive(
['feeds.user_id = :userId'],
['feeds.deleted_at = 0'],
+ ['items.shared_by = \'\''],
['x = y'],
['items.search_index LIKE :term0'],
['items.search_index LIKE :term1'],