From ee49a1d1cca114183aac79aa828fd153fbf0f89b Mon Sep 17 00:00:00 2001 From: WENDLING NICOLAS Date: Sun, 28 Feb 2021 23:15:27 +0100 Subject: =?UTF-8?q?=E2=9C=85=20Fix=20tests=20in=20ItemMapperPaginatedTest:?= =?UTF-8?q?=20-=20testFindAllItemsInvalid=20-=20testFindAllItemsFullInvert?= =?UTF-8?q?ed=20-=20testFindAllItemsUnread=20-=20testFindAllItemsStarred?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Nassabain --- tests/Unit/Db/ItemMapperPaginatedTest.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/Unit/Db/ItemMapperPaginatedTest.php b/tests/Unit/Db/ItemMapperPaginatedTest.php index 964f27029..3e506ffa1 100644 --- a/tests/Unit/Db/ItemMapperPaginatedTest.php +++ b/tests/Unit/Db/ItemMapperPaginatedTest.php @@ -70,14 +70,14 @@ class ItemMapperPaginatedTest extends MapperTestUtility $this->builder->expects($this->exactly(3)) ->method('andWhere') ->withConsecutive( - ['feeds.user_id = :userId'], + ['(feeds.user_id = :userId AND items.shared_by = \'\') OR items.shared_with = :sharedWith'], ['feeds.deleted_at = 0'] ) ->will($this->returnSelf()); - $this->builder->expects($this->exactly(2)) + $this->builder->expects($this->exactly(3)) ->method('setParameter') - ->withConsecutive(['userId', 'jack'], ['offset', 10]) + ->withConsecutive(['userId', 'jack'], ['sharedWith', 'jack'], ['offset', 10]) ->will($this->returnSelf()); @@ -140,15 +140,15 @@ class ItemMapperPaginatedTest extends MapperTestUtility $this->builder->expects($this->exactly(3)) ->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.id > :offset'] ) ->will($this->returnSelf()); - $this->builder->expects($this->exactly(2)) + $this->builder->expects($this->exactly(3)) ->method('setParameter') - ->withConsecutive(['userId', 'jack'], ['offset', 10]) + ->withConsecutive(['userId', 'jack'], ['sharedWith', 'jack'], ['offset', 10]) ->will($this->returnSelf()); @@ -212,7 +212,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility $this->builder->expects($this->exactly(4)) ->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.id < :offset'], ['items.unread = :unread'] @@ -221,7 +221,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility $this->builder->expects($this->exactly(3)) ->method('setParameter') - ->withConsecutive(['userId', 'jack'], ['offset', 10], ['unread', true]) + ->withConsecutive(['userId', 'jack'], ['sharedWith', 'jack'], ['offset', 10], ['unread', true]) ->will($this->returnSelf()); $this->builder->expects($this->exactly(1)) @@ -352,7 +352,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility $this->builder->expects($this->exactly(4)) ->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.id < :offset'], ['items.starred = :starred'] @@ -361,7 +361,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility $this->builder->expects($this->exactly(3)) ->method('setParameter') - ->withConsecutive(['userId', 'jack'], ['offset', 10], ['starred', true]) + ->withConsecutive(['userId', 'jack'], ['sharedWith', 'jack'], ['offset', 10], ['starred', true]) ->will($this->returnSelf()); @@ -1485,4 +1485,4 @@ class ItemMapperPaginatedTest extends MapperTestUtility $this->assertEquals([Item::fromRow(['id' => 4])], $result); } -} \ No newline at end of file +} -- cgit v1.2.3