summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2021-04-13 13:50:31 +0200
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-14 13:56:54 +0200
commit111bf5fff2c9856a9fe9e1935296451183f70f60 (patch)
tree3c7792767333af5994d52f43f8ca46168f353c93 /tests
parent8dc8f98119d630ef3de8e3d5b348ee25088de16a (diff)
DB: only sort on item IDs
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Db/ItemMapperPaginatedTest.php44
-rw-r--r--tests/Unit/Db/ItemMapperTest.php6
2 files changed, 20 insertions, 30 deletions
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
@@ -93,11 +93,6 @@ class ItemMapperPaginatedTest extends MapperTestUtility
->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')
->willReturnSelf();
@@ -164,11 +159,6 @@ class ItemMapperPaginatedTest extends MapperTestUtility
->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')
->willReturnSelf();
@@ -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());
diff --git a/tests/Unit/Db/ItemMapperTest.php b/tests/Unit/Db/ItemMapperTest.php
index 5cb42c3fa..12c022893 100644
--- a/tests/Unit/Db/ItemMapperTest.php
+++ b/tests/Unit/Db/ItemMapperTest.php
@@ -752,7 +752,7 @@ class ItemMapperTest extends MapperTestUtility
->with('starred = false')
->willReturnSelf();
- $builder2->expects($this->once())
+ $builder2->expects($this->never())
->method('orderBy')
->with('last_modified', 'DESC')
->willReturnSelf();
@@ -910,7 +910,7 @@ class ItemMapperTest extends MapperTestUtility
->withConsecutive(['starred = false'], ['unread = false'])
->willReturnSelf();
- $builder2->expects($this->once())
+ $builder2->expects($this->never())
->method('orderBy')
->with('last_modified', 'DESC')
->willReturnSelf();
@@ -1067,7 +1067,7 @@ class ItemMapperTest extends MapperTestUtility
->withConsecutive(['starred = false'], ['unread = false'])
->willReturnSelf();
- $builder2->expects($this->once())
+ $builder2->expects($this->never())
->method('orderBy')
->with('last_modified', 'DESC')
->willReturnSelf();