30 $this->controller = $this->
getAccessibleMock(
'TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController', array(
'dummy'), array(),
'', FALSE);
37 $this->controller->_set(
'maximumNumberOfLinks', 8);
38 $this->controller->_set(
'numberOfPages', 100);
39 $this->controller->_set(
'currentPage', 50);
40 $this->controller->_call(
'calculateDisplayRange');
41 $this->assertSame(46, $this->controller->_get(
'displayRangeStart'));
42 $this->assertSame(53, $this->controller->_get(
'displayRangeEnd'));
49 $this->controller->_set(
'maximumNumberOfLinks', 7);
50 $this->controller->_set(
'numberOfPages', 100);
51 $this->controller->_set(
'currentPage', 50);
52 $this->controller->_call(
'calculateDisplayRange');
53 $this->assertSame(47, $this->controller->_get(
'displayRangeStart'));
54 $this->assertSame(53, $this->controller->_get(
'displayRangeEnd'));
61 $this->controller->_set(
'maximumNumberOfLinks', 8);
62 $this->controller->_set(
'numberOfPages', 100);
63 $this->controller->_set(
'currentPage', 1);
64 $this->controller->_call(
'calculateDisplayRange');
65 $this->assertSame(1, $this->controller->_get(
'displayRangeStart'));
66 $this->assertSame(8, $this->controller->_get(
'displayRangeEnd'));
73 $this->controller->_set(
'maximumNumberOfLinks', 7);
74 $this->controller->_set(
'numberOfPages', 100);
75 $this->controller->_set(
'currentPage', 1);
76 $this->controller->_call(
'calculateDisplayRange');
77 $this->assertSame(1, $this->controller->_get(
'displayRangeStart'));
78 $this->assertSame(7, $this->controller->_get(
'displayRangeEnd'));
85 $this->controller->_set(
'maximumNumberOfLinks', 8);
86 $this->controller->_set(
'numberOfPages', 100);
87 $this->controller->_set(
'currentPage', 100);
88 $this->controller->_call(
'calculateDisplayRange');
89 $this->assertSame(93, $this->controller->_get(
'displayRangeStart'));
90 $this->assertSame(100, $this->controller->_get(
'displayRangeEnd'));
97 $this->controller->_set(
'maximumNumberOfLinks', 7);
98 $this->controller->_set(
'numberOfPages', 100);
99 $this->controller->_set(
'currentPage', 100);
100 $this->controller->_call(
'calculateDisplayRange');
101 $this->assertSame(94, $this->controller->_get(
'displayRangeStart'));
102 $this->assertSame(100, $this->controller->_get(
'displayRangeEnd'));
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)