@@ -71,7 +71,8 @@ public function testRespectsFirstAndAfter(): void
7171 ['first ' => 2 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjE= ' ]
7272 );
7373
74- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], false , true );
74+ // there actually is previous page for ['A', 'B']
75+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , true );
7576
7677 $ this ->assertSameConnection ($ expected , $ actual );
7778 }
@@ -83,7 +84,8 @@ public function testRespectsFirstAndAfterWithLongFirst(): void
8384 ['first ' => 10 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjE= ' ]
8485 );
8586
86- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' , 'E ' ], false , false );
87+ // there actually is previous page for ['A', 'B']
88+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' , 'E ' ], true , false );
8789
8890 $ this ->assertSameConnection ($ expected , $ actual );
8991 }
@@ -95,7 +97,8 @@ public function testRespectsLastAndBefore(): void
9597 ['last ' => 2 , 'before ' => 'YXJyYXljb25uZWN0aW9uOjM= ' ]
9698 );
9799
98- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , false );
100+ // there actually is next page for ['D', 'E']
101+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
99102
100103 $ this ->assertSameConnection ($ expected , $ actual );
101104 }
@@ -107,7 +110,8 @@ public function testRespectsLastAndBeforeWithLongLast(): void
107110 ['last ' => 10 , 'before ' => 'YXJyYXljb25uZWN0aW9uOjM= ' ]
108111 );
109112
110- $ expected = $ this ->getExpectedConnection (['A ' , 'B ' , 'C ' ], false , false );
113+ // there actually is next page for ['E']
114+ $ expected = $ this ->getExpectedConnection (['A ' , 'B ' , 'C ' ], false , true );
111115
112116 $ this ->assertSameConnection ($ expected , $ actual );
113117 }
@@ -119,7 +123,8 @@ public function testRespectsFirstAndAfterAndBeforeTooFew(): void
119123 ['first ' => 2 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
120124 );
121125
122- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], false , true );
126+ // there actually is previous page for ['A']
127+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
123128
124129 $ this ->assertSameConnection ($ expected , $ actual );
125130 }
@@ -131,7 +136,8 @@ public function testRespectsFirstAndAfterAndBeforeTooMany(): void
131136 ['first ' => 4 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
132137 );
133138
134- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
139+ // there actually is previous and next page (for ['A'] or ['E'])
140+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
135141
136142 $ this ->assertSameConnection ($ expected , $ actual );
137143 }
@@ -143,7 +149,8 @@ public function testRespectsFirstAndAfterAndBeforeExactlyRight(): void
143149 ['first ' => 3 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
144150 );
145151
146- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
152+ // there actually is previous and next page (for ['A'] or ['E'])
153+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
147154
148155 $ this ->assertSameConnection ($ expected , $ actual );
149156 }
@@ -155,7 +162,8 @@ public function testRespectsLastAndAfterAndBeforeTooFew(): void
155162 ['last ' => 2 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
156163 );
157164
158- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , false );
165+ // there actually is next page for ['E']
166+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , true );
159167
160168 $ this ->assertSameConnection ($ expected , $ actual );
161169 }
@@ -167,7 +175,8 @@ public function testRespectsLastAndAfterAndBeforeTooMany(): void
167175 ['last ' => 4 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
168176 );
169177
170- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
178+ // there actually is previous and next page (for ['A'] or ['E'])
179+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
171180
172181 $ this ->assertSameConnection ($ expected , $ actual );
173182 }
@@ -179,7 +188,8 @@ public function testRespectsLastAndAfterAndBeforeExactlyRight(): void
179188 ['last ' => 3 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
180189 );
181190
182- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
191+ // there actually is previous and next page (for ['A'] or ['E'])
192+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
183193
184194 $ this ->assertSameConnection ($ expected , $ actual );
185195 }
@@ -266,7 +276,8 @@ public function testWorksWithAJustRightArraySlice(): void
266276 ['sliceStart ' => 1 , 'arrayLength ' => 5 ]
267277 );
268278
269- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], false , true );
279+ // there actually is previous page for ['A']
280+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
270281
271282 $ this ->assertSameConnection ($ expected , $ actual );
272283 }
@@ -282,7 +293,8 @@ public function testWorksWithAnOversizedArraySliceLeftSide(): void
282293 ['sliceStart ' => 0 , 'arrayLength ' => 5 ]
283294 );
284295
285- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], false , true );
296+ // there actually is previous page for ['A']
297+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
286298
287299 $ this ->assertSameConnection ($ expected , $ actual );
288300 }
@@ -298,7 +310,8 @@ public function testWorksWithAnOversizedArraySliceRightSide(): void
298310 ['sliceStart ' => 2 , 'arrayLength ' => 5 ]
299311 );
300312
301- $ expected = $ this ->getExpectedConnection (['C ' ], false , true );
313+ // there actually is previous page for ['A', 'B']
314+ $ expected = $ this ->getExpectedConnection (['C ' ], true , true );
302315
303316 $ this ->assertSameConnection ($ expected , $ actual );
304317 }
@@ -314,7 +327,8 @@ public function testWorksWithAnOversizedArraySliceBothSides(): void
314327 ['sliceStart ' => 1 , 'arrayLength ' => 5 ]
315328 );
316329
317- $ expected = $ this ->getExpectedConnection (['C ' ], false , true );
330+ // there actually is previous page for ['A', 'B']
331+ $ expected = $ this ->getExpectedConnection (['C ' ], true , true );
318332
319333 $ this ->assertSameConnection ($ expected , $ actual );
320334 }
@@ -330,7 +344,8 @@ public function testWorksWithAnUndersizedArraySliceLeftSide(): void
330344 ['sliceStart ' => 3 , 'arrayLength ' => 5 ]
331345 );
332346
333- $ expected = $ this ->getExpectedConnection (['D ' , 'E ' ], false , false );
347+ // there actually is previous page for ['A', 'B', 'C']
348+ $ expected = $ this ->getExpectedConnection (['D ' , 'E ' ], true , false );
334349
335350 $ this ->assertSameConnection ($ expected , $ actual );
336351 }
@@ -346,7 +361,8 @@ public function testWorksWithAnUndersizedArraySliceRightSide(): void
346361 ['sliceStart ' => 2 , 'arrayLength ' => 5 ]
347362 );
348363
349- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], false , true );
364+ // there actually is previous page for ['A', 'B']
365+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , true );
350366
351367 $ this ->assertSameConnection ($ expected , $ actual );
352368 }
@@ -362,7 +378,8 @@ public function worksWithAnUndersizedArraySliceBothSides(): void
362378 ['sliceStart ' => 3 , 'arrayLength ' => 5 ]
363379 );
364380
365- $ expected = $ this ->getExpectedConnection (['D ' ], false , true );
381+ // there actually is previous page for ['A', 'B', 'C']
382+ $ expected = $ this ->getExpectedConnection (['D ' ], true , true );
366383
367384 $ this ->assertSameConnection ($ expected , $ actual );
368385 }
0 commit comments