Test on Pagination view control.
More...
Test on Pagination view control.
Definition at line 32 of file PaginationTest.php.
◆ getFactory()
PaginationTest::getFactory |
( |
| ) |
|
|
private |
◆ getUIFactory()
PaginationTest::getUIFactory |
( |
| ) |
|
◆ testAttributes()
PaginationTest::testAttributes |
( |
| ) |
|
Definition at line 70 of file PaginationTest.php.
References Vendor\Package\$f, and getFactory().
76 $target_url =
'http://testurl';
77 $parameter_name =
"param_name";
78 $max_page_options = 10;
82 ->withTargetURL($target_url, $parameter_name)
83 ->withTotalEntries($total_entries)
84 ->withPageSize($page_size)
85 ->withCurrentPage($current_page)
86 ->withMaxPaginationButtons($max_page_options)
89 $this->assertEquals($target_url, $p->getTargetURL());
90 $this->assertEquals($parameter_name, $p->getParameterName());
91 $this->assertEquals($page_size, $p->getPageSize());
92 $this->assertEquals($current_page, $p->getCurrentPage());
93 $this->assertEquals($max_page_options, $p->getMaxPaginationButtons());
94 $this->assertEquals(2, $p->getNumberOfPages());
◆ testConstruction()
PaginationTest::testConstruction |
( |
| ) |
|
Definition at line 62 of file PaginationTest.php.
References Vendor\Package\$f, and getFactory().
65 $pagination =
$f->pagination();
66 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Pagination", $pagination);
67 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal", $pagination->getInternalSignal());
◆ testGetRangeOnNull()
PaginationTest::testGetRangeOnNull |
( |
| ) |
|
◆ testRenderDropdown()
PaginationTest::testRenderDropdown |
( |
| ) |
|
Definition at line 240 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
243 ->withTotalEntries(3)
247 $expected_html = <<<EOT
248 <div
class=
"il-viewcontrol-pagination l-bar__element">
249 <
button class=
"btn btn-default" data-action=
"?pagination_offset=0" disabled=
"disabled">
250 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
252 <div
class=
"dropdown" id=
"id_4">
253 <
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_4_menu">pagination_label_x_of_y<span
class=
"caret"></span></
button>
254 <ul
id=
"id_4_menu" class=
"dropdown-menu">
256 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=0" id=
"id_1">1</button>
259 <button
class=
"btn btn-link" data-action=
"?pagination_offset=1" id=
"id_2">2</button>
262 <button
class=
"btn btn-link" data-action=
"?pagination_offset=2" id=
"id_3">3</button>
266 <button
class=
"btn btn-default" data-action=
"?pagination_offset=1" id=
"id_5">
267 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
271 $html = $this->getDefaultRenderer()->render($p);
273 $this->brutallyTrimHTML($expected_html),
274 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderLimited()
PaginationTest::testRenderLimited |
( |
| ) |
|
Definition at line 151 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
154 ->withTotalEntries(3)
156 ->withMaxPaginationButtons(1);
161 $expected_html = <<<EOT
162 <div
class=
"il-viewcontrol-pagination l-bar__element">
163 <
button class=
"btn btn-default" data-action=
"?pagination_offset=0" disabled=
"disabled">
164 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
166 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=0" id=
"id_1">1</button>
167 <span
class=
"last"><button
class=
"btn btn-link" data-action=
"?pagination_offset=2" id=
"id_2">3</button></span>
168 <button
class=
"btn btn-default" data-action=
"?pagination_offset=1" id=
"id_3">
169 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
173 $html = $this->getDefaultRenderer()->render($p);
175 $this->brutallyTrimHTML($expected_html),
176 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderLimitedWithCurrentPage()
PaginationTest::testRenderLimitedWithCurrentPage |
( |
| ) |
|
Definition at line 180 of file PaginationTest.php.
References ILIAS\Repository\button(), and getFactory().
183 ->withTotalEntries(3)
185 ->withMaxPaginationButtons(1)
186 ->withCurrentPage(1);
191 $expected_html = <<<EOT
192 <div
class=
"il-viewcontrol-pagination l-bar__element">
193 <
button class=
"btn btn-default" data-action=
"?pagination_offset=0" id=
"id_4">
194 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
195 </
button><span
class=
"first"><
button class=
"btn btn-link" data-action=
"?pagination_offset=0" id=
"id_2">1</
button></span>
196 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=1" id=
"id_1">2</button>
197 <span
class=
"last"><button
class=
"btn btn-link" data-action=
"?pagination_offset=2" id=
"id_3">3</button></span>
198 <button
class=
"btn btn-default" data-action=
"?pagination_offset=2" id=
"id_5">
199 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
203 $html = $this->getDefaultRenderer()->render($p);
204 $this->assertHTMLEquals(
205 $this->brutallyTrimHTML($expected_html),
206 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderLimitedWithCurrentPage2()
PaginationTest::testRenderLimitedWithCurrentPage2 |
( |
| ) |
|
Definition at line 210 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
213 ->withTotalEntries(3)
215 ->withMaxPaginationButtons(1)
216 ->withCurrentPage(2);
221 $expected_html = <<<EOT
222 <div
class=
"il-viewcontrol-pagination l-bar__element">
223 <
button class=
"btn btn-default" data-action=
"?pagination_offset=1" id=
"id_3">
224 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
226 <span
class=
"first"><
button class=
"btn btn-link" data-action=
"?pagination_offset=0" id=
"id_2">1</
button></span>
227 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=2" id=
"id_1">3</button>
228 <button
class=
"btn btn-default" data-action=
"?pagination_offset=3" disabled=
"disabled">
229 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
233 $html = $this->getDefaultRenderer()->render($p);
235 $this->brutallyTrimHTML($expected_html),
236 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderWithCurrentPage()
PaginationTest::testRenderWithCurrentPage |
( |
| ) |
|
Definition at line 122 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
125 ->withTotalEntries(2)
127 ->withCurrentPage(1);
131 $expected_html = <<<EOT
132 <div
class=
"il-viewcontrol-pagination l-bar__element">
133 <
button class=
"btn btn-default" data-action=
"?pagination_offset=0" id=
"id_3">
134 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
136 <
button class=
"btn btn-link" data-action=
"?pagination_offset=0" id=
"id_1">1</button>
137 <button
class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=1" id=
"id_2">2</button>
138 <button
class=
"btn btn-default" data-action=
"?pagination_offset=2" disabled=
"disabled">
139 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
144 $html = $this->getDefaultRenderer()->render($p);
145 $this->assertHTMLEquals(
146 $this->brutallyTrimHTML($expected_html),
147 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderWithOnePageOnly()
PaginationTest::testRenderWithOnePageOnly |
( |
| ) |
|
Definition at line 292 of file PaginationTest.php.
References getFactory().
295 ->withTotalEntries(30)
298 $html = $this->getDefaultRenderer()->render($p);
299 $this->assertEquals($expected_html, $html);
◆ testViewControlPaginationRenderUnlimited()
PaginationTest::testViewControlPaginationRenderUnlimited |
( |
| ) |
|
Definition at line 97 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
100 ->withTotalEntries(2)
105 $expected_html = <<<EOT
106 <div
class=
"il-viewcontrol-pagination l-bar__element">
107 <
button class=
"btn btn-default" data-action=
"?pagination_offset=0" disabled=
"disabled">
108 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
110 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=0" id=
"id_1">1</button>
111 <button
class=
"btn btn-link" data-action=
"?pagination_offset=1" id=
"id_2">2</button>
112 <button
class=
"btn btn-default" data-action=
"?pagination_offset=1" id=
"id_3">
113 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
118 $html = $this->getDefaultRenderer()->render($p);
119 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($html));
button(string $caption, string $cmd)
The documentation for this class was generated from the following file: