3 declare(strict_types=1);
21 require_once(
"libs/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../Base.php");
37 public function symbol(): C\Symbol\Factory
39 return new IC\Symbol\Factory(
45 public function button(): C\Button\Factory
47 return new IC\Button\Factory();
49 public function dropdown(): C\Dropdown\Factory
51 return new IC\Dropdown\Factory();
65 $pagination =
$f->pagination();
66 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Pagination", $pagination);
67 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal", $pagination->getInternalSignal());
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());
100 ->withTotalEntries(2)
105 $expected_html = <<<EOT
106 <div
class=
"il-viewcontrol-pagination">
107 <span
class=
"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=
"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>
131 ->withTotalEntries(2)
133 ->withCurrentPage(1);
137 $expected_html = <<<EOT
138 <div
class=
"il-viewcontrol-pagination">
139 <span
class=
"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=
"browse next">
149 <a
class=
"glyph disabled" aria-label=
"next" aria-
disabled=
"true">
150 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
163 ->withTotalEntries(3)
165 ->withMaxPaginationButtons(1);
170 $expected_html = <<<EOT
171 <div
class=
"il-viewcontrol-pagination">
172 <span
class=
"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=
"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>
198 ->withTotalEntries(3)
200 ->withMaxPaginationButtons(1)
201 ->withCurrentPage(1);
206 $expected_html = <<<EOT
207 <div
class=
"il-viewcontrol-pagination">
208 <span
class=
"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=
"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>
238 ->withTotalEntries(3)
240 ->withMaxPaginationButtons(1)
241 ->withCurrentPage(2);
246 $expected_html = <<<EOT
247 <div
class=
"il-viewcontrol-pagination">
248 <span
class=
"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=
"browse next">
260 <a
class=
"glyph disabled" aria-label=
"next" aria-
disabled=
"true">
261 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
275 ->withTotalEntries(3)
279 $expected_html = <<<EOT
280 <div
class=
"il-viewcontrol-pagination">
281 <span
class=
"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">
288 <button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" id=
"id_4" 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=
"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>
313 $pagination = $this->
getFactory()->pagination()
314 ->withCurrentPage($current_page)
315 ->withPageSize($page_size);
317 $this->assertNull($pagination->getRange());
318 $this->assertEquals($range, $pagination->getRange());
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Provides common functionality for UI tests.