Tests for the Renderer of DataTables.
More...
Tests for the Renderer of DataTables.
Definition at line 73 of file DataRendererTest.php.
◆ getActionFactory()
DataRendererTest::getActionFactory |
( |
| ) |
|
|
private |
◆ getColumnFactory()
DataRendererTest::getColumnFactory |
( |
| ) |
|
|
private |
◆ getDataFactory()
DataRendererTest::getDataFactory |
( |
| ) |
|
◆ getDummyRequest()
DataRendererTest::getDummyRequest |
( |
| ) |
|
|
private |
Definition at line 100 of file DataRendererTest.php.
102 $request = $this->createMock(ServerRequestInterface::class);
105 ->willReturn(
new class () {
106 public function __toString()
108 return 'http://localhost:80';
113 ->method(
"getQueryParams")
◆ getRenderer()
DataRendererTest::getRenderer |
( |
| ) |
|
|
private |
◆ getUIFactory()
DataRendererTest::getUIFactory |
( |
| ) |
|
Definition at line 123 of file DataRendererTest.php.
References $factory, and ILIAS\GlobalScreen\Provider\__construct().
126 protected Component\Table\Factory $table_factory;
130 $this->table_factory = $table_factory;
134 return new I\Button\Factory();
138 return new I\Dropdown\Factory();
142 return new I\Symbol\Factory(
150 return $this->table_factory;
154 return new I\Divider\Factory();
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...
__construct(Container $dic, ilPlugin $plugin)
◆ testDataTableDataRowFromBuilder()
DataRendererTest::testDataTableDataRowFromBuilder |
( |
array |
$params | ) |
|
testDataTableRowBuilder
Definition at line 466 of file DataRendererTest.php.
References $params.
468 list($rb, $columns, $actions) =
$params;
474 $row = $rb->buildDataRow(
'row_id-1', $record);
486 $row->getCellContent(
'f2')
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
◆ testDataTableGetActionRegistration()
DataRendererTest::testDataTableGetActionRegistration |
( |
| ) |
|
Definition at line 175 of file DataRendererTest.php.
References Vendor\Package\$f, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().
181 list($builder,
$token) = $url_builder->acquireParameter([
'namespace'],
'param');
183 $action =
$f->standard(
'label', $builder,
$token);
184 $closure = $renderer->p_getActionRegistration(
'action_id', $action);
189 'il.UI.table.data.get(\'component_id\').registerAction(\'action_id\', false, new il.UI.core.URLBuilder(new URL("http://wwww.ilias.de?ref_id=1&namespace_param="), new Map([["namespace_param",new il.UI.core.URLBuilderToken(["namespace"], "param",' 191 $this->assertStringStartsWith($expected, $actual);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testDataTableGetMultiActionHandler()
DataRendererTest::testDataTableGetMultiActionHandler |
( |
| ) |
|
Definition at line 160 of file DataRendererTest.php.
163 $signal =
new I\Signal(
'signal_id');
164 $closure = $renderer->p_getMultiActionHandler($signal);
167 "$(document).on('signal_id', function(event, signal_data) { 168 il.UI.table.data.get('component_id').doMultiAction(signal_data); 172 $this->assertEquals($expected, $actual);
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testDataTableMultiActionsDropdown()
DataRendererTest::testDataTableMultiActionsDropdown |
( |
| ) |
|
Definition at line 194 of file DataRendererTest.php.
References Vendor\Package\$f, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().
198 $signal1 =
new I\Signal(
'signal_id');
199 $signal2 =
new I\Signal(
'signal_id2');
202 list($builder,
$token) = $url_builder->acquireParameter([
'namespace'],
'param');
204 $f->standard(
'label1', $builder,
$token),
205 $f->standard(
'label2', $builder,
$token)
208 $renderer->p_buildMultiActionsDropdown([], $signal1, $signal2)
212 count($renderer->p_buildMultiActionsDropdown($actions, $signal1, $signal2)->getItems())
◆ testDataTableRenderHeaderWithActions()
DataRendererTest::testDataTableRenderHeaderWithActions |
( |
| ) |
|
Definition at line 387 of file DataRendererTest.php.
References $data, Vendor\Package\$f, $token, $tpl, and $url.
390 $data_factory = new \ILIAS\Data\Factory();
391 $tpl = $this->
getTemplateFactory()->getTemplate(
"src/UI/templates/default/Table/tpl.datatable.html",
true,
true);
394 $url = $data_factory->uri(
'http://wwww.ilias.de?ref_id=1');
396 list($builder,
$token) = $url_builder->acquireParameter([
'namespace'],
'param');
402 public function getRows(
403 Component\Table\DataRowBuilder $row_builder,
404 array $visible_column_ids,
408 ?array $additional_parameters
410 yield $row_builder->buldDataRow(
'', []);
412 public function getTotalRowCount(
414 ?array $additional_parameters
420 'f1' =>
$f->text(
"Field 1")->withIsSortable(
false),
423 $sortation_signal = null;
426 ->withActions($actions)
431 $expected =
'<th class="c-table-data__header c-table-data__cell c-table-data__header__rowaction" role="columnheader" aria-colindex="1">actions</th>';
432 $this->assertStringContainsString($expected, $actual);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Both the subject and the direction need to be specified when expressing an order. ...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
A simple class to express a range of whole positive numbers.
◆ testDataTableRenderHeaderWithoutSortableColums()
DataRendererTest::testDataTableRenderHeaderWithoutSortableColums |
( |
| ) |
|
Definition at line 314 of file DataRendererTest.php.
References $data, Vendor\Package\$f, and $tpl.
317 $data_factory = new \ILIAS\Data\Factory();
318 $tpl = $this->
getTemplateFactory()->getTemplate(
"src/UI/templates/default/Table/tpl.datatable.html",
true,
true);
321 public function getRows(
322 Component\Table\DataRowBuilder $row_builder,
323 array $visible_column_ids,
327 ?array $additional_parameters
329 yield $row_builder->buldDataRow(
'', []);
331 public function getTotalRowCount(
333 ?array $additional_parameters
339 'f1' =>
$f->text(
"Field 1")->withIsSortable(
false),
340 'f2' =>
$f->text(
"Field 2")->withIsSortable(
false)
343 $sortation_signal = null;
350 <div
class=
"c-table-data" id=
"{ID}">
351 <div
class=
"viewcontrols">{VIEW_CONTROLS}</div>
352 <div
class=
"c-table-data__table-wrapper">
353 <table
class=
"c-table-data__table" role=
"grid" aria-labelledby=
"{ID}_label" aria-colcount=
"{COL_COUNT}">
355 <tr
class=
"c-table-data__header c-table-data__row" role=
"rowgroup">
356 <th
class=
"c-table-data__header c-table-data__cell c-table-data__cell--text" role=
"columnheader" tabindex=
"-1" aria-colindex=
"0">
357 <div
class=
"c-table-data__header__resize-wrapper">Field 1</div>
359 <th
class=
"c-table-data__header c-table-data__cell c-table-data__cell--text" role=
"columnheader" tabindex=
"-1" aria-colindex=
"1">
360 <div
class=
"c-table-data__header__resize-wrapper">Field 2</div>
364 <tbody
class=
"c-table-data__body" role=
"rowgroup"></tbody>
368 <div
class=
"c-table-data__async_modal_container"></div>
370 <div
class=
"c-table-data__async_message modal" role=
"dialog" id=
"{ID}_msgmodal">
371 <div
class=
"modal-dialog" role=
"document">
372 <div
class=
"modal-content">
373 <div
class=
"modal-header">
374 <button type=
"button" class=
"close" data-dismiss=
"modal" aria-label=
"close"><span aria-hidden=
"true">×</span></button>
376 <div
class=
"c-table-data__async_messageresponse modal-body"></div>
384 $this->assertEquals($expected, $actual);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Both the subject and the direction need to be specified when expressing an order. ...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
A simple class to express a range of whole positive numbers.
◆ testDataTableRenderStandardRow()
DataRendererTest::testDataTableRenderStandardRow |
( |
I\Table\DataRow |
$row | ) |
|
testDataTableDataRowFromBuilder
Definition at line 495 of file DataRendererTest.php.
499 <td
class=
"c-table-data__cell c-table-data__rowselection" role=
"gridcell" tabindex=
"-1">
500 <input type=
"checkbox" value=
"row_id-1" class=
"c-table-data__row-selector">
502 <td
class=
"c-table-data__cell c-table-data__cell--text " role=
"gridcell" aria-colindex=
"1" tabindex=
"-1">
503 <span
class=
"c-table-data__cell__col-title">Field 1:</span>v1
505 <td
class=
"c-table-data__cell c-table-data__cell--text " role=
"gridcell" aria-colindex=
"2" tabindex=
"-1">
506 <span
class=
"c-table-data__cell__col-title">Field 2:</span>v2
508 <td
class=
"c-table-data__cell c-table-data__cell--number " role=
"gridcell" aria-colindex=
"3" tabindex=
"-1">
509 <span
class=
"c-table-data__cell__col-title">Field 3:</span>3
511 <td
class=
"c-table-data__cell c-table-data__rowaction" role=
"gridcell" tabindex=
"-1">
512 <div
class=
"dropdown">
513 <button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" id=
"id_3" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu"><span
class=
"caret"></span></button>
514 <ul
id=
"id_3_menu" class=
"dropdown-menu">
515 <li><button
class=
"btn btn-link" data-action=
"http://wwww.ilias.de?ref_id=1&namespace_param%5B%5D=row_id-1" id=
"id_1">label1</button></li>
516 <li><button
class=
"btn btn-link" data-action=
"http://wwww.ilias.de?ref_id=1&namespace_param%5B%5D=row_id-1" id=
"id_2">label2</button></li>
522 $this->assertEquals($expected, $actual);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testDataTableRenderTableHeader()
DataRendererTest::testDataTableRenderTableHeader |
( |
| ) |
|
Definition at line 232 of file DataRendererTest.php.
References $data, Vendor\Package\$f, and $tpl.
235 $data_factory = new \ILIAS\Data\Factory();
236 $tpl = $this->
getTemplateFactory()->getTemplate(
"src/UI/templates/default/Table/tpl.datatable.html",
true,
true);
239 public function getRows(
240 Component\Table\DataRowBuilder $row_builder,
241 array $visible_column_ids,
245 ?array $additional_parameters
247 yield $row_builder->buldDataRow(
'', []);
249 public function getTotalRowCount(
251 ?array $additional_parameters
257 'f1' =>
$f->text(
"Field 1")->withIndex(1),
258 'f2' =>
$f->text(
"Field 2")->withIndex(2)->withIsSortable(
false),
259 'f3' =>
$f->number(
"Field 3")->withIndex(3)
261 $sortation_signal =
new I\Signal(
'sort_header_signal_id');
262 $sortation_signal->addOption(
'value',
'f1:ASC');
269 <div
class=
"c-table-data" id=
"{ID}">
270 <div
class=
"viewcontrols">{VIEW_CONTROLS}</div>
271 <div
class=
"c-table-data__table-wrapper">
272 <table
class=
"c-table-data__table" role=
"grid" aria-labelledby=
"{ID}_label" aria-colcount=
"{COL_COUNT}">
274 <tr
class=
"c-table-data__header c-table-data__row" role=
"rowgroup">
275 <th
class=
"c-table-data__header c-table-data__cell c-table-data__cell--text" role=
"columnheader" tabindex=
"-1" aria-colindex=
"0" aria-sort=
"order_option_generic_ascending">
276 <div
class=
"c-table-data__header__resize-wrapper">
277 <a tabindex=
"0" class=
"glyph" href=
"#" aria-label=
"sort_ascending" id=
"id_2"><span
class=
"glyphicon glyphicon-arrow-up" aria-hidden=
"true"></span></a>
278 <button
class=
"btn btn-link" id=
"id_1">Field 1</button>
281 <th
class=
"c-table-data__header c-table-data__cell c-table-data__cell--text" role=
"columnheader" tabindex=
"-1" aria-colindex=
"1">
282 <div
class=
"c-table-data__header__resize-wrapper">Field 2</div>
284 <th
class=
"c-table-data__header c-table-data__cell c-table-data__cell--number" role=
"columnheader" tabindex=
"-1" aria-colindex=
"2">
285 <div
class=
"c-table-data__header__resize-wrapper">
286 <button
class=
"btn btn-link" id=
"id_3">Field 3</button>
291 <tbody
class=
"c-table-data__body" role=
"rowgroup"></tbody>
294 <div
class=
"c-table-data__async_modal_container"></div>
296 <div
class=
"c-table-data__async_message modal" role=
"dialog" id=
"{ID}_msgmodal">
297 <div
class=
"modal-dialog" role=
"document">
298 <div
class=
"modal-content">
299 <div
class=
"modal-header">
300 <button type=
"button" class=
"close" data-dismiss=
"modal" aria-label=
"close"><span aria-hidden=
"true">×</span></button>
302 <div
class=
"c-table-data__async_messageresponse modal-body"></div>
310 $this->assertEquals($expected, $actual);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Both the subject and the direction need to be specified when expressing an order. ...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
A simple class to express a range of whole positive numbers.
◆ testDataTableRowBuilder()
DataRendererTest::testDataTableRowBuilder |
( |
| ) |
|
Definition at line 435 of file DataRendererTest.php.
References Vendor\Package\$f, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().
439 'f1' =>
$f->text(
"Field 1")->withIndex(1),
440 'f2' =>
$f->text(
"Field 2")->withIndex(2),
441 'f3' =>
$f->number(
"Field 3")->withIndex(3)
446 list($builder,
$token) = $url_builder->acquireParameter([
'namespace'],
'param');
448 'a1' =>
$f->standard(
'label1', $builder,
$token)->withAsync(),
449 'a2' =>
$f->standard(
'label2', $builder,
$token)
452 $rb = (
new I\Table\DataRowBuilder())
453 ->withMultiActionsPresent(
true)
454 ->withSingleActions($actions)
455 ->withVisibleColumns($columns);
457 $row = $rb->buildDataRow(
'row_id-1', []);
458 $this->assertInstanceOf(
Component\Table\DataRow::class, $row);
460 return [$rb, $columns, $actions];
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testDataTableSingleActionsDropdown()
DataRendererTest::testDataTableSingleActionsDropdown |
( |
| ) |
|
Definition at line 215 of file DataRendererTest.php.
References Vendor\Package\$f, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().
221 list($builder,
$token) = $url_builder->acquireParameter([
'namespace'],
'param');
223 'a1' =>
$f->standard(
'label1', $builder,
$token)->withAsync(),
224 'a2' =>
$f->standard(
'label2', $builder,
$token)
228 count($renderer->p_getSingleActionsForRow(
'row_id-1', $actions)->getItems())
◆ testRenderEmptyDataCell()
DataRendererTest::testRenderEmptyDataCell |
( |
| ) |
|
Definition at line 525 of file DataRendererTest.php.
References $data, and ILIAS\UI\Implementation\Component\Input\getLanguage().
528 public function getRows(
529 Component\Table\DataRowBuilder $row_builder,
530 array $visible_column_ids,
534 ?array $additional_parameters
539 public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?
int 546 'f1' => $this->
getUIFactory()->table()->column()->text(
'f1'),
547 'f2' => $this->
getUIFactory()->table()->column()->text(
'f2'),
548 'f3' => $this->
getUIFactory()->table()->column()->text(
'f3'),
549 'f4' => $this->
getUIFactory()->table()->column()->text(
'f4'),
550 'f5' => $this->
getUIFactory()->table()->column()->text(
'f5'),
558 $translation = $this->
getLanguage()->txt(
'ui_table_no_records');
559 $column_count = count($columns);
562 $this->assertTrue(str_contains($html,
"colspan=\"$column_count\""));
564 $this->assertTrue(str_contains($html, $translation));
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...
Both the subject and the direction need to be specified when expressing an order. ...
A simple class to express a range of whole positive numbers.
The documentation for this class was generated from the following file: