summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAurélien <dav.aurelien@gmail.com>2021-02-28 21:30:58 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 22:31:21 +0200
commitdd4617d3685fe0db59b8cd82848933fa2a118c5d (patch)
tree06b96e5a1055a0b9763b4f62d9547a496941d80b /tests
parent5a12e50ccaef6981012d342b510a19ede81e0bfa (diff)
Fix findFromUser, testFindAllFromUserWithParams, testFindAllFromUser
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Db/ItemMapperTest.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/Unit/Db/ItemMapperTest.php b/tests/Unit/Db/ItemMapperTest.php
index e42df1bf7..b4a5ab118 100644
--- a/tests/Unit/Db/ItemMapperTest.php
+++ b/tests/Unit/Db/ItemMapperTest.php
@@ -93,7 +93,7 @@ class ItemMapperTest extends MapperTestUtility
$this->builder->expects($this->once())
->method('where')
- ->with('feeds.user_id = :user_id')
+ ->with('(feeds.user_id = :user_id AND items.shared_by = \'\') OR items.shared_with = :shared_with')
->will($this->returnSelf());
$this->builder->expects($this->once())
@@ -101,9 +101,9 @@ class ItemMapperTest extends MapperTestUtility
->with('feeds.deleted_at = 0')
->will($this->returnSelf());
- $this->builder->expects($this->exactly(1))
+ $this->builder->expects($this->exactly(2))
->method('setParameter')
- ->withConsecutive(['user_id', 'jack'])
+ ->withConsecutive(['user_id', 'jack'], ['shared_with', 'jack'])
->will($this->returnSelf());
$this->builder->expects($this->once())
@@ -154,7 +154,7 @@ class ItemMapperTest extends MapperTestUtility
$this->builder->expects($this->once())
->method('where')
- ->with('feeds.user_id = :user_id')
+ ->with('(feeds.user_id = :user_id AND items.shared_by = \'\') OR items.shared_with = :shared_with')
->will($this->returnSelf());
$this->builder->expects($this->exactly(2))
@@ -162,9 +162,9 @@ class ItemMapperTest extends MapperTestUtility
->withConsecutive(['feeds.deleted_at = 0'], ['key = :val'])
->will($this->returnSelf());
- $this->builder->expects($this->exactly(1))
- ->method('setParameter')
- ->withConsecutive(['user_id', 'jack'])
+ $this->builder->expects($this->exactly(2))
+ ->method('setParameter')
+ ->withConsecutive(['user_id', 'jack'], ['shared_with', 'jack'])
->will($this->returnSelf());
$this->builder->expects($this->once())
@@ -296,7 +296,7 @@ class ItemMapperTest extends MapperTestUtility
$this->builder->expects($this->once())
->method('where')
- ->with('feeds.user_id = :user_id')
+ ->with('(feeds.user_id = :user_id AND items.shared_by = \'\') OR items.shared_with = :shared_with')
->will($this->returnSelf());
$this->builder->expects($this->exactly(2))
@@ -304,9 +304,9 @@ class ItemMapperTest extends MapperTestUtility
->withConsecutive(['items.id = :item_id'], ['feeds.deleted_at = 0'])
->will($this->returnSelf());
- $this->builder->expects($this->exactly(2))
+ $this->builder->expects($this->exactly(3))
->method('setParameter')
- ->withConsecutive(['user_id', 'jack'], ['item_id', 4])
+ ->withConsecutive(['user_id', 'jack'], ['shared_with', 'jack'], ['item_id', 4])
->will($this->returnSelf());
$this->builder->expects($this->once())