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 272 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
275 ->withTotalEntries(3)
279 $expected_html = <<<EOT
280 <div
class=
"il-viewcontrol-pagination l-bar__element">
281 <span
class=
"btn btn-ctrl browse previous">
282 <a
class=
"glyph disabled" aria-label=
"back" aria-
disabled=
"true">
283 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
287 <div
class=
"dropdown" id=
"id_4">
288 <
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>
289 <ul
id=
"id_4_menu" class=
"dropdown-menu">
290 <li><
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=0" id=
"id_1">1</button></li>
291 <li><button
class=
"btn btn-link" data-action=
"?pagination_offset=1" id=
"id_2">2</button></li>
292 <li><button
class=
"btn btn-link" data-action=
"?pagination_offset=2" id=
"id_3">3</button></li>
296 <span
class=
"btn btn-ctrl browse next">
297 <a tabindex=
"0" class=
"glyph" href=
"?pagination_offset=1" aria-label=
"next">
298 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
303 $html = $this->getDefaultRenderer()->render($p);
304 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($html));
button(string $caption, string $cmd)
◆ testRenderLimited()
PaginationTest::testRenderLimited |
( |
| ) |
|
Definition at line 160 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
163 ->withTotalEntries(3)
165 ->withMaxPaginationButtons(1);
170 $expected_html = <<<EOT
171 <div
class=
"il-viewcontrol-pagination l-bar__element">
172 <span
class=
"btn btn-ctrl browse previous">
173 <a
class=
"glyph disabled" aria-label=
"back" aria-
disabled=
"true">
174 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
178 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=0" id=
"id_1">1</button>
181 <button
class=
"btn btn-link" data-action=
"?pagination_offset=2" id=
"id_2">3</button>
184 <span
class=
"btn btn-ctrl browse next">
185 <a tabindex=
"0" class=
"glyph" href=
"?pagination_offset=1" aria-label=
"next">
186 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
191 $html = $this->getDefaultRenderer()->render($p);
192 $this->assertHTMLEquals($expected_html, $html);
button(string $caption, string $cmd)
◆ testRenderLimitedWithCurrentPage()
PaginationTest::testRenderLimitedWithCurrentPage |
( |
| ) |
|
Definition at line 195 of file PaginationTest.php.
References ILIAS\Repository\button(), and getFactory().
198 ->withTotalEntries(3)
200 ->withMaxPaginationButtons(1)
201 ->withCurrentPage(1);
206 $expected_html = <<<EOT
207 <div
class=
"il-viewcontrol-pagination l-bar__element">
208 <span
class=
"btn btn-ctrl browse previous">
209 <a tabindex=
"0" class=
"glyph" href=
"?pagination_offset=0" aria-label=
"back">
210 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
215 <
button class=
"btn btn-link" data-action=
"?pagination_offset=0" id=
"id_2">1</
button>
218 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=1" id=
"id_1">2</button>
221 <button
class=
"btn btn-link" data-action=
"?pagination_offset=2" id=
"id_3">3</button>
224 <span
class=
"btn btn-ctrl browse next">
225 <a tabindex=
"0" class=
"glyph" href=
"?pagination_offset=2" aria-label=
"next">
226 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
231 $html = $this->getDefaultRenderer()->render($p);
232 $this->assertHTMLEquals($expected_html, $html);
button(string $caption, string $cmd)
◆ testRenderLimitedWithCurrentPage2()
PaginationTest::testRenderLimitedWithCurrentPage2 |
( |
| ) |
|
Definition at line 235 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
238 ->withTotalEntries(3)
240 ->withMaxPaginationButtons(1)
241 ->withCurrentPage(2);
246 $expected_html = <<<EOT
247 <div
class=
"il-viewcontrol-pagination l-bar__element">
248 <span
class=
"btn btn-ctrl browse previous">
249 <a tabindex=
"0" class=
"glyph" href=
"?pagination_offset=1" aria-label=
"back">
250 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
254 <
button class=
"btn btn-link" data-action=
"?pagination_offset=0" id=
"id_2">1</
button>
257 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=2" id=
"id_1">3</button>
259 <span
class=
"btn btn-ctrl browse next">
260 <a
class=
"glyph disabled" aria-label=
"next" aria-
disabled=
"true">
261 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
266 $html = $this->getDefaultRenderer()->render($p);
267 $this->assertHTMLEquals($expected_html, $html);
button(string $caption, string $cmd)
◆ testRenderWithCurrentPage()
PaginationTest::testRenderWithCurrentPage |
( |
| ) |
|
Definition at line 128 of file PaginationTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and getFactory().
131 ->withTotalEntries(2)
133 ->withCurrentPage(1);
137 $expected_html = <<<EOT
138 <div
class=
"il-viewcontrol-pagination l-bar__element">
139 <span
class=
"btn btn-ctrl browse previous">
140 <a tabindex=
"0" class=
"glyph" href=
"?pagination_offset=0" aria-label=
"back">
141 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
145 <
button class=
"btn btn-link" data-action=
"?pagination_offset=0" id=
"id_1">1</button>
146 <button
class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=1" id=
"id_2">2</button>
148 <span
class=
"btn btn-ctrl browse next">
149 <a
class=
"glyph disabled" aria-label=
"next" aria-
disabled=
"true">
150 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
156 $html = $this->getDefaultRenderer()->render($p);
157 $this->assertHTMLEquals($expected_html, $html);
button(string $caption, string $cmd)
◆ testRenderWithOnePageOnly()
PaginationTest::testRenderWithOnePageOnly |
( |
| ) |
|
Definition at line 321 of file PaginationTest.php.
References getFactory().
324 ->withTotalEntries(30)
327 $html = $this->getDefaultRenderer()->render($p);
328 $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 <span
class=
"btn btn-ctrl browse previous">
108 <a
class=
"glyph disabled" aria-label=
"back" aria-
disabled=
"true">
109 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
113 <
button class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"?pagination_offset=0" id=
"id_1">1</button>
114 <button
class=
"btn btn-link" data-action=
"?pagination_offset=1" id=
"id_2">2</button>
116 <span
class=
"btn btn-ctrl browse next">
117 <a tabindex=
"0" class=
"glyph" href=
"?pagination_offset=1" aria-label=
"next">
118 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
124 $html = $this->getDefaultRenderer()->render($p);
125 $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: