Complex classes like PagerfantaTest often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use PagerfantaTest, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
22 | class PagerfantaTest extends \PHPUnit_Framework_TestCase |
||
23 | { |
||
24 | private $adapter; |
||
25 | /** |
||
26 | * @var Pagerfanta |
||
27 | */ |
||
28 | private $pagerfanta; |
||
29 | |||
30 | protected function setUp() |
||
31 | { |
||
32 | $this->adapter = $this->getMockBuilder('Pagerfanta\Adapter\AdapterInterface')->getMock(); |
||
33 | $this->pagerfanta = new Pagerfanta($this->adapter); |
||
34 | } |
||
35 | |||
36 | private function setAdapterNbResultsAny($nbResults) |
||
37 | { |
||
38 | $this->setAdapterNbResults($this->any(), $nbResults); |
||
39 | } |
||
40 | |||
41 | private function setAdapterNbResultsOnce($nbResults) |
||
42 | { |
||
43 | $this->setAdapterNbResults($this->once(), $nbResults); |
||
44 | } |
||
45 | |||
46 | private function setAdapterNbResults($expects, $nbResults) |
||
47 | { |
||
48 | $this->adapter |
||
49 | ->expects($expects) |
||
50 | ->method('getNbResults') |
||
51 | ->will($this->returnValue($nbResults)); |
||
52 | } |
||
53 | |||
54 | public function testGetAdapterShouldReturnTheAdapter() |
||
55 | { |
||
56 | $this->assertSame($this->adapter, $this->pagerfanta->getAdapter()); |
||
57 | } |
||
58 | |||
59 | public function testGetAllowOutOfRangePagesShouldBeFalseByDefault() |
||
63 | |||
64 | public function testSetAllowOutOfRangePagesShouldSetTrue() |
||
65 | { |
||
66 | $this->pagerfanta->setAllowOutOfRangePages(true); |
||
67 | $this->assertTrue($this->pagerfanta->getAllowOutOfRangePages()); |
||
68 | } |
||
69 | |||
70 | public function testSetAllowOutOfRangePagesShouldSetFalse() |
||
71 | { |
||
72 | $this->pagerfanta->setAllowOutOfRangePages(false); |
||
73 | $this->assertFalse($this->pagerfanta->getAllowOutOfRangePages()); |
||
74 | } |
||
75 | |||
76 | public function testSetAllowOutOfRangePagesShouldReturnThePagerfanta() |
||
77 | { |
||
78 | $this->assertSame($this->pagerfanta, $this->pagerfanta->setAllowOutOfRangePages(true)); |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @expectedException \Pagerfanta\Exception\NotBooleanException |
||
83 | * @dataProvider notBooleanProvider |
||
84 | */ |
||
85 | public function testSetAllowOutOfRangePagesShouldThrowNotBooleanExceptionWhenNotBoolean($value) |
||
86 | { |
||
87 | $this->pagerfanta->setAllowOutOfRangePages($value); |
||
88 | } |
||
89 | |||
90 | public function testGetNormalizeOutOfRangePagesShouldBeFalseByDefault() |
||
94 | |||
95 | public function testSetNormalizeOutOfRangePagesShouldSetTrue() |
||
96 | { |
||
97 | $this->pagerfanta->setNormalizeOutOfRangePages(true); |
||
98 | $this->assertTrue($this->pagerfanta->getNormalizeOutOfRangePages()); |
||
99 | } |
||
100 | |||
101 | public function testSetNormalizeOutOfRangePagesShouldSetFalse() |
||
102 | { |
||
103 | $this->pagerfanta->setNormalizeOutOfRangePages(false); |
||
104 | $this->assertFalse($this->pagerfanta->getNormalizeOutOfRangePages()); |
||
105 | } |
||
106 | |||
107 | public function testSetNormalizeOutOfRangePagesShouldReturnThePagerfanta() |
||
108 | { |
||
109 | $this->assertSame($this->pagerfanta, $this->pagerfanta->setNormalizeOutOfRangePages(true)); |
||
110 | } |
||
111 | |||
112 | /** |
||
113 | * @expectedException \Pagerfanta\Exception\NotBooleanException |
||
114 | * @dataProvider notBooleanProvider |
||
115 | */ |
||
116 | public function testSetNormalizeOutOfRangePagesShouldThrowNotBooleanExceptionWhenNotBoolean($value) |
||
117 | { |
||
118 | $this->pagerfanta->setNormalizeOutOfRangePages($value); |
||
119 | } |
||
120 | |||
121 | public function notBooleanProvider() |
||
122 | { |
||
123 | return array( |
||
124 | array(1), |
||
125 | array('1'), |
||
126 | array(1.1), |
||
127 | ); |
||
128 | } |
||
129 | |||
130 | /** |
||
131 | * @dataProvider setMaxPerPageShouldSetAnIntegerProvider |
||
132 | */ |
||
133 | public function testSetMaxPerPageShouldSetAnInteger($maxPerPage) |
||
134 | { |
||
135 | $this->pagerfanta->setMaxPerPage($maxPerPage); |
||
136 | |||
137 | $this->assertSame($maxPerPage, $this->pagerfanta->getMaxPerPage()); |
||
138 | } |
||
139 | |||
140 | public function setMaxPerPageShouldSetAnIntegerProvider() |
||
141 | { |
||
142 | return array( |
||
143 | array(1), |
||
144 | array(10), |
||
145 | array(25), |
||
146 | ); |
||
147 | } |
||
148 | |||
149 | /** |
||
150 | * @dataProvider setMaxPerPageShouldConvertStringsToIntegersProvider |
||
151 | */ |
||
152 | public function testSetMaxPerPageShouldConvertStringsToIntegers($maxPerPage) |
||
153 | { |
||
154 | $this->pagerfanta->setMaxPerPage($maxPerPage); |
||
155 | $this->assertSame((int) $maxPerPage, $this->pagerfanta->getMaxPerPage()); |
||
156 | } |
||
157 | |||
158 | public function setMaxPerPageShouldConvertStringsToIntegersProvider() |
||
159 | { |
||
160 | return array( |
||
161 | array('1'), |
||
162 | array('10'), |
||
163 | array('25'), |
||
164 | ); |
||
165 | } |
||
166 | |||
167 | public function testSetMaxPerPageShouldReturnThePagerfanta() |
||
168 | { |
||
169 | $this->assertSame($this->pagerfanta, $this->pagerfanta->setMaxPerPage(10)); |
||
170 | } |
||
171 | |||
172 | /** |
||
173 | * @expectedException \Pagerfanta\Exception\NotIntegerMaxPerPageException |
||
174 | * @dataProvider setMaxPerPageShouldThrowExceptionWhenInvalidProvider |
||
175 | */ |
||
176 | public function testSetMaxPerPageShouldThrowExceptionWhenInvalid($maxPerPage) |
||
177 | { |
||
178 | $this->pagerfanta->setMaxPerPage($maxPerPage); |
||
179 | } |
||
180 | |||
181 | public function setMaxPerPageShouldThrowExceptionWhenInvalidProvider() |
||
182 | { |
||
183 | return array( |
||
184 | array(1.1), |
||
185 | array('1.1'), |
||
186 | array(true), |
||
187 | array(array(1)), |
||
188 | ); |
||
189 | } |
||
190 | |||
191 | /** |
||
192 | * @expectedException \Pagerfanta\Exception\LessThan1MaxPerPageException |
||
193 | * @dataProvider setMaxPerPageShouldThrowExceptionWhenLessThan1Provider |
||
194 | */ |
||
195 | public function testSetMaxPerPageShouldThrowExceptionWhenLessThan1($maxPerPage) |
||
196 | { |
||
197 | $this->pagerfanta->setMaxPerPage($maxPerPage); |
||
198 | } |
||
199 | |||
200 | public function setMaxPerPageShouldThrowExceptionWhenLessThan1Provider() |
||
201 | { |
||
202 | return array( |
||
203 | array(0), |
||
204 | array(-1), |
||
205 | ); |
||
206 | } |
||
207 | |||
208 | public function testSetMaxPerPageShouldResetCurrentPageResults() |
||
209 | { |
||
210 | $pagerfanta = $this->pagerfanta; |
||
211 | |||
212 | $this->assertResetCurrentPageResults(function () use ($pagerfanta) { |
||
213 | $pagerfanta->setMaxPerPage(10); |
||
214 | }); |
||
215 | } |
||
216 | |||
217 | public function testSetMaxPerPageShouldResetNbResults() |
||
218 | { |
||
219 | $this->prepareForResetNbResults(); |
||
220 | |||
221 | $this->assertSame(100, $this->pagerfanta->getNbResults()); |
||
222 | $this->pagerfanta->setMaxPerPage(10); |
||
223 | $this->assertSame(50, $this->pagerfanta->getNbResults()); |
||
224 | } |
||
225 | |||
226 | public function testSetMaxPerPageShouldResetNbPages() |
||
227 | { |
||
228 | $this->prepareForResetNbResults(); |
||
229 | |||
230 | $this->assertSame(10, $this->pagerfanta->getNbPages()); |
||
231 | $this->pagerfanta->setMaxPerPage(10); |
||
232 | $this->assertSame(5, $this->pagerfanta->getNbPages()); |
||
233 | } |
||
234 | |||
235 | private function prepareForResetNbResults() |
||
236 | { |
||
237 | $this->pagerfanta->setMaxPerPage(10); |
||
238 | |||
239 | $this->adapter |
||
240 | ->expects($this->at(0)) |
||
241 | ->method('getNbResults') |
||
242 | ->will($this->returnValue(100)); |
||
243 | $this->adapter |
||
244 | ->expects($this->at(1)) |
||
245 | ->method('getNbResults') |
||
246 | ->will($this->returnValue(50)); |
||
247 | } |
||
248 | |||
249 | public function testGetNbResultsShouldReturnTheNbResultsFromTheAdapter() |
||
250 | { |
||
251 | $this->setAdapterNbResultsAny(20); |
||
252 | |||
253 | $this->assertSame(20, $this->pagerfanta->getNbResults()); |
||
254 | } |
||
255 | |||
256 | public function testGetNbResultsShouldCacheTheNbResultsFromTheAdapter() |
||
257 | { |
||
258 | $this->setAdapterNbResultsOnce(20); |
||
259 | |||
260 | $this->pagerfanta->getNbResults(); |
||
261 | $this->pagerfanta->getNbResults(); |
||
262 | } |
||
263 | |||
264 | public function testGetNbPagesShouldCalculateTheNumberOfPages() |
||
265 | { |
||
266 | $this->setAdapterNbResultsAny(100); |
||
267 | $this->pagerfanta->setMaxPerPage(20); |
||
268 | |||
269 | $this->assertSame(5, $this->pagerfanta->getNbPages()); |
||
270 | } |
||
271 | |||
272 | public function testGetNbPagesShouldRoundToUp() |
||
273 | { |
||
274 | $this->setAdapterNbResultsAny(100); |
||
275 | $this->pagerfanta->setMaxPerPage(15); |
||
276 | |||
277 | $this->assertSame(7, $this->pagerfanta->getNbPages()); |
||
278 | } |
||
279 | |||
280 | public function testGetNbPagesShouldReturn1WhenThereAreNoResults() |
||
286 | |||
287 | /** |
||
288 | * @dataProvider setCurrentPageShouldSetAnIntegerProvider |
||
289 | */ |
||
290 | public function testSetCurrentPageShouldSetAnInteger($currentPage) |
||
291 | { |
||
292 | $this->setAdapterNbResultsAny(100); |
||
293 | $this->pagerfanta->setMaxPerPage(2); |
||
294 | $this->pagerfanta->setCurrentPage($currentPage); |
||
295 | |||
296 | $this->assertSame($currentPage, $this->pagerfanta->getCurrentPage()); |
||
297 | } |
||
298 | |||
299 | public function setCurrentPageShouldSetAnIntegerProvider() |
||
300 | { |
||
301 | return array( |
||
302 | array(1), |
||
303 | array(10), |
||
304 | array(25), |
||
305 | ); |
||
306 | } |
||
307 | |||
308 | /** |
||
309 | * @dataProvider setCurrentPageShouldConvertStringsToIntegersProvider |
||
310 | */ |
||
311 | public function testSetCurrentPageShouldConvertStringsToIntegers($currentPage) |
||
312 | { |
||
313 | $this->setAdapterNbResultsAny(100); |
||
314 | $this->pagerfanta->setMaxPerPage(2); |
||
315 | $this->pagerfanta->setCurrentPage($currentPage); |
||
316 | |||
317 | $this->assertSame((int) $currentPage, $this->pagerfanta->getCurrentPage()); |
||
318 | } |
||
319 | |||
320 | public function setCurrentPageShouldConvertStringsToIntegersProvider() |
||
321 | { |
||
322 | return array( |
||
323 | array('1'), |
||
324 | array('10'), |
||
325 | array('25'), |
||
326 | ); |
||
327 | } |
||
328 | |||
329 | /** |
||
330 | * @expectedException Pagerfanta\Exception\NotIntegerCurrentPageException |
||
331 | * @dataProvider setCurrentPageShouldThrowExceptionWhenInvalidProvider |
||
332 | */ |
||
333 | public function testSetCurrentPageShouldThrowExceptionWhenInvalid($currentPage) |
||
334 | { |
||
335 | $this->pagerfanta->setCurrentPage($currentPage); |
||
336 | } |
||
337 | |||
338 | public function setCurrentPageShouldThrowExceptionWhenInvalidProvider() |
||
339 | { |
||
340 | return array( |
||
341 | array(1.1), |
||
342 | array('1.1'), |
||
343 | array(true), |
||
344 | array(array(1)), |
||
345 | ); |
||
346 | } |
||
347 | |||
348 | /** |
||
349 | * @expectedException Pagerfanta\Exception\LessThan1CurrentPageException |
||
350 | * @dataProvider setCurrentPageShouldThrowExceptionWhenLessThan1Provider |
||
351 | */ |
||
352 | public function testCurrentPagePageShouldThrowExceptionWhenLessThan1($currentPage) |
||
353 | { |
||
354 | $this->pagerfanta->setCurrentPage($currentPage); |
||
355 | } |
||
356 | |||
357 | public function setCurrentPageShouldThrowExceptionWhenLessThan1Provider() |
||
358 | { |
||
359 | return array( |
||
360 | array(0), |
||
361 | array(-1), |
||
362 | ); |
||
363 | } |
||
364 | |||
365 | /** |
||
366 | * @expectedException Pagerfanta\Exception\OutOfRangeCurrentPageException |
||
367 | */ |
||
368 | public function testSetCurrentPageShouldThrowExceptionWhenThePageIsOutOfRange() |
||
369 | { |
||
370 | $this->setAdapterNbResultsAny(100); |
||
371 | $this->pagerfanta->setMaxPerPage(10); |
||
372 | $this->pagerfanta->setCurrentPage(11); |
||
373 | } |
||
374 | |||
375 | public function testSetCurrentPageShouldNotThrowExceptionWhenIndicatingAllowOurOfRangePages() |
||
376 | { |
||
377 | $this->setAdapterNbResultsAny(100); |
||
378 | $this->pagerfanta->setMaxPerPage(10); |
||
379 | $this->pagerfanta->setAllowOutOfRangePages(true); |
||
380 | $this->pagerfanta->setCurrentPage(11); |
||
381 | |||
382 | $this->assertSame(11, $this->pagerfanta->getCurrentPage()); |
||
383 | } |
||
384 | |||
385 | public function testSetCurrentPageShouldNotThrowExceptionWhenIndicatingAllowOurOfRangePagesWithOldBooleanArguments() |
||
386 | { |
||
387 | $this->setAdapterNbResultsAny(100); |
||
388 | $this->pagerfanta->setMaxPerPage(10); |
||
389 | $this->pagerfanta->setCurrentPage(11, true); |
||
390 | |||
391 | $this->assertSame(11, $this->pagerfanta->getCurrentPage()); |
||
392 | } |
||
393 | |||
394 | public function testSetCurrentPageShouldReturnThePagerfanta() |
||
395 | { |
||
396 | $this->setAdapterNbResultsAny(100); |
||
397 | $this->pagerfanta->setMaxPerPage(10); |
||
398 | |||
399 | $this->assertSame($this->pagerfanta, $this->pagerfanta->setCurrentPage(1)); |
||
400 | } |
||
401 | |||
402 | public function testSetCurrentPageShouldNormalizePageWhenOutOfRangePageAndIndicatingNormalizeOutOfRangePages() |
||
403 | { |
||
404 | $this->setAdapterNbResultsAny(100); |
||
405 | $this->pagerfanta->setMaxPerPage(10); |
||
406 | $this->pagerfanta->setAllowOutOfRangePages(false); |
||
407 | $this->pagerfanta->setNormalizeOutOfRangePages(true); |
||
408 | $this->pagerfanta->setCurrentPage(11); |
||
409 | |||
410 | $this->assertSame(10, $this->pagerfanta->getCurrentPage()); |
||
411 | } |
||
412 | |||
413 | public function testSetCurrentPageShouldNormalizePageWhenOutOfRangePageAndIndicatingNormalizeOutOfRangePagesWithDeprecatedBooleansArguments() |
||
414 | { |
||
415 | $this->setAdapterNbResultsAny(100); |
||
416 | $this->pagerfanta->setMaxPerPage(10); |
||
417 | $this->pagerfanta->setCurrentPage(11, false, true); |
||
418 | |||
419 | $this->assertSame(10, $this->pagerfanta->getCurrentPage()); |
||
420 | } |
||
421 | |||
422 | public function testSetCurrentPageShouldResetCurrentPageResults() |
||
423 | { |
||
424 | $pagerfanta = $this->pagerfanta; |
||
425 | |||
426 | $this->assertResetCurrentPageResults(function () use ($pagerfanta) { |
||
427 | $pagerfanta->setCurrentPage(1); |
||
428 | }); |
||
429 | } |
||
430 | |||
431 | /** |
||
432 | * @dataProvider testGetCurrentPageResultsShouldReturnASliceFromTheAdapterDependingOnTheCurrentPageAndMaxPerPageProvider |
||
433 | */ |
||
434 | public function testGetCurrentPageResultsShouldReturnASliceFromTheAdapterDependingOnTheCurrentPageAndMaxPerPage($maxPerPage, $currentPage, $offset) |
||
435 | { |
||
436 | $this->setAdapterNbResultsAny(100); |
||
437 | $this->pagerfanta->setMaxPerPage($maxPerPage); |
||
438 | $this->pagerfanta->setCurrentPage($currentPage); |
||
439 | |||
440 | $currentPageResults = new \ArrayObject(); |
||
441 | |||
442 | $this->adapter |
||
443 | ->expects($this->any()) |
||
444 | ->method('getSlice') |
||
445 | ->with($this->equalTo($offset), $this->equalTo($maxPerPage)) |
||
446 | ->will($this->returnValue($currentPageResults)); |
||
447 | |||
448 | $this->assertSame($currentPageResults, $this->pagerfanta->getCurrentPageResults()); |
||
449 | } |
||
450 | |||
451 | public function testGetCurrentPageResultsShouldReturnASliceFromTheAdapterDependingOnTheCurrentPageAndMaxPerPageProvider() |
||
452 | { |
||
453 | // max per page, current page, offset |
||
454 | return array( |
||
455 | array(10, 1, 0), |
||
456 | array(10, 2, 10), |
||
457 | array(20, 3, 40), |
||
458 | ); |
||
459 | } |
||
460 | |||
461 | public function testGetCurrentPageResultsShouldCacheTheResults() |
||
462 | { |
||
463 | $this->setAdapterNbResultsAny(100); |
||
464 | $this->pagerfanta->setMaxPerPage(10); |
||
465 | $this->pagerfanta->setCurrentPage(1); |
||
466 | |||
467 | $currentPageResults = new \ArrayObject(); |
||
468 | |||
469 | $this->adapter |
||
470 | ->expects($this->once()) |
||
471 | ->method('getSlice') |
||
472 | ->will($this->returnValue($currentPageResults)); |
||
473 | |||
474 | $this->pagerfanta->getCurrentPageResults(); |
||
475 | $this->assertSame($currentPageResults, $this->pagerfanta->getCurrentPageResults()); |
||
476 | } |
||
477 | |||
478 | public function testGetCurrentPageOffsetStart() |
||
479 | { |
||
480 | $this->setAdapterNbResultsAny(100); |
||
481 | $this->pagerfanta->setMaxPerPage(10); |
||
482 | $this->pagerfanta->setCurrentPage(2); |
||
483 | |||
484 | $this->assertSame(11, $this->pagerfanta->getCurrentPageOffsetStart()); |
||
485 | } |
||
486 | |||
487 | public function testGetCurrentPageOffsetStartWith0NbResults() |
||
495 | |||
496 | public function testGetCurrentPageOffsetEnd() |
||
497 | { |
||
498 | $this->setAdapterNbResultsAny(100); |
||
499 | $this->pagerfanta->setMaxPerPage(10); |
||
500 | $this->pagerfanta->setCurrentPage(2); |
||
501 | |||
502 | $this->assertSame(20, $this->pagerfanta->getCurrentPageOffsetEnd()); |
||
503 | } |
||
504 | |||
505 | public function testGetCurrentPageOffsetEndOnEndPage() |
||
506 | { |
||
507 | $this->setAdapterNbResultsAny(90); |
||
508 | $this->pagerfanta->setMaxPerPage(20); |
||
509 | $this->pagerfanta->setCurrentPage(5); |
||
510 | |||
511 | $this->assertSame(90, $this->pagerfanta->getCurrentPageOffsetEnd()); |
||
512 | } |
||
513 | |||
514 | public function testHaveToPaginateReturnsTrueWhenTheNumberOfResultsIsGreaterThanTheMaxPerPage() |
||
515 | { |
||
516 | $this->setAdapterNbResultsAny(100); |
||
517 | $this->pagerfanta->setMaxPerPage(99); |
||
518 | |||
519 | $this->assertTrue($this->pagerfanta->haveToPaginate()); |
||
520 | } |
||
521 | |||
522 | public function testHaveToPaginateReturnsFalseWhenTheNumberOfResultsIsEqualToMaxPerPage() |
||
523 | { |
||
524 | $this->setAdapterNbResultsAny(100); |
||
525 | $this->pagerfanta->setMaxPerPage(100); |
||
526 | |||
527 | $this->assertFalse($this->pagerfanta->haveToPaginate()); |
||
528 | } |
||
529 | |||
530 | public function testHaveToPaginateReturnsFalseWhenTheNumberOfResultsIsLessThanMaxPerPage() |
||
531 | { |
||
532 | $this->setAdapterNbResultsAny(100); |
||
533 | $this->pagerfanta->setMaxPerPage(101); |
||
534 | |||
535 | $this->assertFalse($this->pagerfanta->haveToPaginate()); |
||
536 | } |
||
537 | |||
538 | public function testHasPreviousPageShouldReturnTrueWhenTheCurrentPageIsGreaterThan1() |
||
539 | { |
||
540 | $this->setAdapterNbResultsAny(100); |
||
541 | |||
542 | foreach (array(2, 3) as $page) { |
||
543 | $this->pagerfanta->setCurrentPage($page); |
||
544 | $this->assertTrue($this->pagerfanta->hasPreviousPage()); |
||
545 | } |
||
546 | } |
||
547 | |||
548 | public function testHasPreviousPageShouldReturnFalseWhenTheCurrentPageIs1() |
||
549 | { |
||
550 | $this->setAdapterNbResultsAny(100); |
||
551 | $this->pagerfanta->setCurrentPage(1); |
||
555 | |||
556 | public function testGetPreviousPageShouldReturnThePreviousPage() |
||
566 | |||
567 | /** |
||
568 | * @expectedException Pagerfanta\Exception\LogicException |
||
569 | */ |
||
570 | public function testGetPreviousPageShouldThrowALogicExceptionIfThereIsNoPreviousPage() |
||
578 | |||
579 | public function testHasNextPageShouldReturnTrueIfTheCurrentPageIsNotTheLast() |
||
589 | |||
590 | public function testHasNextPageShouldReturnFalseIfTheCurrentPageIsTheLast() |
||
598 | |||
599 | public function testGetNextPageShouldReturnTheNextPage() |
||
609 | |||
610 | /** |
||
611 | * @expectedException Pagerfanta\Exception\LogicException |
||
612 | */ |
||
613 | public function testGetNextPageShouldThrowALogicExceptionIfTheCurrentPageIsTheLast() |
||
621 | |||
622 | public function testCountShouldReturnNbResults() |
||
628 | |||
629 | public function testPagerfantaShouldImplementCountableInterface() |
||
633 | |||
634 | public function testGetIteratorShouldReturnCurrentPageResultsIfItIsAnIterator() |
||
642 | |||
643 | public function testGetIteratorShouldReturnTheIteratorOfCurrentPageResultsIfItIsAnIteratorAggregate() |
||
651 | |||
652 | public function testGetIteratorShouldReturnAnArrayIteratorIfCurrentPageResultsIsAnArray() |
||
660 | |||
661 | private function setAdapterGetSlice($currentPageResults) |
||
668 | |||
669 | public function testPagerfantaShouldImplementIteratorAggregateInterface() |
||
673 | |||
674 | public function testLazyAdapterDoNotCallsGetNbResultsOnSetCurrentPage() |
||
686 | |||
687 | /** |
||
688 | * @expectedException Pagerfanta\Exception\OutOfRangeCurrentPageException |
||
689 | */ |
||
690 | public function testLazyAdapterCallsGetNbResultsOnGetCurrentPageResults() |
||
709 | |||
710 | private function assertResetCurrentPageResults($callback) |
||
731 | } |
||
732 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.