From e658820e19a045cd6e08b79d1800805b47d6c011 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Tue, 13 Apr 2021 13:50:31 +0200 Subject: DB: only sort on item IDs Signed-off-by: Sean Molenaar --- tests/Unit/Db/ItemMapperPaginatedTest.php | 44 ++++++++++++------------------- 1 file changed, 17 insertions(+), 27 deletions(-) (limited to 'tests/Unit/Db/ItemMapperPaginatedTest.php') diff --git a/tests/Unit/Db/ItemMapperPaginatedTest.php b/tests/Unit/Db/ItemMapperPaginatedTest.php index 448622280..652e2fa98 100644 --- a/tests/Unit/Db/ItemMapperPaginatedTest.php +++ b/tests/Unit/Db/ItemMapperPaginatedTest.php @@ -92,11 +92,6 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) - ->method('orderBy') - ->with('items.last_modified', 'DESC') - ->will($this->returnSelf()); - $this->builder->expects($this->once()) ->method('addOrderBy') ->with('items.id', 'DESC') @@ -163,11 +158,6 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) - ->method('orderBy') - ->with('items.last_modified', 'ASC') - ->will($this->returnSelf()); - $this->builder->expects($this->once()) ->method('addOrderBy') ->with('items.id', 'ASC') @@ -234,7 +224,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -303,7 +293,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -375,7 +365,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -429,9 +419,9 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->withConsecutive( ['feeds.user_id = :userId'], ['feeds.deleted_at = 0'], + ['items.id < :offset'], ['items.search_index LIKE :term0'], ['items.search_index LIKE :term1'], - ['items.id < :offset'], ['items.starred = :starred'] ) ->will($this->returnSelf()); @@ -440,9 +430,9 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->method('setParameter') ->withConsecutive( ['userId', 'jack'], + ['offset', 10], ['term0', '%key%'], ['term1', '%word%'], - ['offset', 10], ['starred', true] ) ->will($this->returnSelf()); @@ -459,7 +449,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -532,7 +522,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -603,7 +593,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -674,7 +664,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'ASC') ->will($this->returnSelf()); @@ -748,7 +738,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -832,7 +822,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -917,7 +907,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -991,7 +981,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->will($this->returnSelf()); - $this->builder->expects($this->never(1)) + $this->builder->expects($this->never()) ->method('setMaxResults'); @@ -1000,7 +990,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -1086,7 +1076,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); @@ -1172,7 +1162,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'ASC') ->will($this->returnSelf()); @@ -1262,7 +1252,7 @@ class ItemMapperPaginatedTest extends MapperTestUtility ->with(10) ->will($this->returnSelf()); - $this->builder->expects($this->once()) + $this->builder->expects($this->never()) ->method('orderBy') ->with('items.last_modified', 'DESC') ->will($this->returnSelf()); -- cgit v1.2.3