@@ -73,7 +73,8 @@ public function testRespectsFirstAndAfter(): void
7373 ['first ' => 2 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjE= ' ]
7474 );
7575
76- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], false , true );
76+ // there actually is previous page for ['A', 'B']
77+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , true );
7778
7879 $ this ->assertSameConnection ($ expected , $ actual );
7980 }
@@ -86,7 +87,8 @@ public function testRespectsFirstAndAfterWithLongFirst(): void
8687 ['first ' => 10 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjE= ' ]
8788 );
8889
89- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' , 'E ' ], false , false );
90+ // there actually is previous page for ['A', 'B']
91+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' , 'E ' ], true , false );
9092
9193 $ this ->assertSameConnection ($ expected , $ actual );
9294 }
@@ -99,7 +101,8 @@ public function testRespectsLastAndBefore(): void
99101 ['last ' => 2 , 'before ' => 'YXJyYXljb25uZWN0aW9uOjM= ' ]
100102 );
101103
102- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , false );
104+ // there actually is next page for ['D', 'E']
105+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
103106
104107 $ this ->assertSameConnection ($ expected , $ actual );
105108 }
@@ -112,7 +115,8 @@ public function testRespectsLastAndBeforeWithLongLast(): void
112115 ['last ' => 10 , 'before ' => 'YXJyYXljb25uZWN0aW9uOjM= ' ]
113116 );
114117
115- $ expected = $ this ->getExpectedConnection (['A ' , 'B ' , 'C ' ], false , false );
118+ // there actually is next page for ['E']
119+ $ expected = $ this ->getExpectedConnection (['A ' , 'B ' , 'C ' ], false , true );
116120
117121 $ this ->assertSameConnection ($ expected , $ actual );
118122 }
@@ -125,7 +129,8 @@ public function testRespectsFirstAndAfterAndBeforeTooFew(): void
125129 ['first ' => 2 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
126130 );
127131
128- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], false , true );
132+ // there actually is previous page for ['A']
133+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
129134
130135 $ this ->assertSameConnection ($ expected , $ actual );
131136 }
@@ -138,7 +143,8 @@ public function testRespectsFirstAndAfterAndBeforeTooMany(): void
138143 ['first ' => 4 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
139144 );
140145
141- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
146+ // there actually is previous and next page (for ['A'] or ['E'])
147+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
142148
143149 $ this ->assertSameConnection ($ expected , $ actual );
144150 }
@@ -151,7 +157,8 @@ public function testRespectsFirstAndAfterAndBeforeExactlyRight(): void
151157 ['first ' => 3 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
152158 );
153159
154- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
160+ // there actually is previous and next page (for ['A'] or ['E'])
161+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
155162
156163 $ this ->assertSameConnection ($ expected , $ actual );
157164 }
@@ -164,7 +171,8 @@ public function testRespectsLastAndAfterAndBeforeTooFew(): void
164171 ['last ' => 2 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
165172 );
166173
167- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , false );
174+ // there actually is next page for ['E']
175+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , true );
168176
169177 $ this ->assertSameConnection ($ expected , $ actual );
170178 }
@@ -177,7 +185,8 @@ public function testRespectsLastAndAfterAndBeforeTooMany(): void
177185 ['last ' => 4 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
178186 );
179187
180- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
188+ // there actually is previous and next page (for ['A'] or ['E'])
189+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
181190
182191 $ this ->assertSameConnection ($ expected , $ actual );
183192 }
@@ -190,7 +199,8 @@ public function testRespectsLastAndAfterAndBeforeExactlyRight(): void
190199 ['last ' => 3 , 'after ' => 'YXJyYXljb25uZWN0aW9uOjA= ' , 'before ' => 'YXJyYXljb25uZWN0aW9uOjQ= ' ]
191200 );
192201
193- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], false , false );
202+ // there actually is previous and next page (for ['A'] or ['E'])
203+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' , 'D ' ], true , true );
194204
195205 $ this ->assertSameConnection ($ expected , $ actual );
196206 }
@@ -284,7 +294,8 @@ public function testWorksWithAJustRightArraySlice(): void
284294 ['sliceStart ' => 1 , 'arrayLength ' => 5 ]
285295 );
286296
287- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], false , true );
297+ // there actually is previous page for ['A']
298+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
288299
289300 $ this ->assertSameConnection ($ expected , $ actual );
290301 }
@@ -301,7 +312,8 @@ public function testWorksWithAnOversizedArraySliceLeftSide(): void
301312 ['sliceStart ' => 0 , 'arrayLength ' => 5 ]
302313 );
303314
304- $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], false , true );
315+ // there actually is previous page for ['A']
316+ $ expected = $ this ->getExpectedConnection (['B ' , 'C ' ], true , true );
305317
306318 $ this ->assertSameConnection ($ expected , $ actual );
307319 }
@@ -318,7 +330,8 @@ public function testWorksWithAnOversizedArraySliceRightSide(): void
318330 ['sliceStart ' => 2 , 'arrayLength ' => 5 ]
319331 );
320332
321- $ expected = $ this ->getExpectedConnection (['C ' ], false , true );
333+ // there actually is previous page for ['A', 'B']
334+ $ expected = $ this ->getExpectedConnection (['C ' ], true , true );
322335
323336 $ this ->assertSameConnection ($ expected , $ actual );
324337 }
@@ -335,7 +348,8 @@ public function testWorksWithAnOversizedArraySliceBothSides(): void
335348 ['sliceStart ' => 1 , 'arrayLength ' => 5 ]
336349 );
337350
338- $ expected = $ this ->getExpectedConnection (['C ' ], false , true );
351+ // there actually is previous page for ['A', 'B']
352+ $ expected = $ this ->getExpectedConnection (['C ' ], true , true );
339353
340354 $ this ->assertSameConnection ($ expected , $ actual );
341355 }
@@ -352,7 +366,8 @@ public function testWorksWithAnUndersizedArraySliceLeftSide(): void
352366 ['sliceStart ' => 3 , 'arrayLength ' => 5 ]
353367 );
354368
355- $ expected = $ this ->getExpectedConnection (['D ' , 'E ' ], false , false );
369+ // there actually is previous page for ['A', 'B', 'C']
370+ $ expected = $ this ->getExpectedConnection (['D ' , 'E ' ], true , false );
356371
357372 $ this ->assertSameConnection ($ expected , $ actual );
358373 }
@@ -369,7 +384,8 @@ public function testWorksWithAnUndersizedArraySliceRightSide(): void
369384 ['sliceStart ' => 2 , 'arrayLength ' => 5 ]
370385 );
371386
372- $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], false , true );
387+ // there actually is previous page for ['A', 'B']
388+ $ expected = $ this ->getExpectedConnection (['C ' , 'D ' ], true , true );
373389
374390 $ this ->assertSameConnection ($ expected , $ actual );
375391 }
@@ -386,7 +402,8 @@ public function worksWithAnUndersizedArraySliceBothSides(): void
386402 ['sliceStart ' => 3 , 'arrayLength ' => 5 ]
387403 );
388404
389- $ expected = $ this ->getExpectedConnection (['D ' ], false , true );
405+ // there actually is previous page for ['A', 'B', 'C']
406+ $ expected = $ this ->getExpectedConnection (['D ' ], true , true );
390407
391408 $ this ->assertSameConnection ($ expected , $ actual );
392409 }
0 commit comments