ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DataRendererTest Class Reference

Tests for the Renderer of DataTables. More...

+ Inheritance diagram for DataRendererTest:
+ Collaboration diagram for DataRendererTest:

Public Member Functions

 getDataFactory ()
 
 getUIFactory ()
 
 testDataTableGetMultiActionHandler ()
 
 testDataTableGetActionRegistration ()
 
 testDataTableMultiActionsDropdown ()
 
 testDataTableSingleActionsDropdown ()
 
 testDataTableRenderTableHeader ()
 
 testDataTableRenderHeaderWithoutSortableColums ()
 
 testDataTableRenderHeaderWithActions ()
 
 testDataTableRowBuilder ()
 
 testDataTableDataRowFromBuilder (array $params)
 testDataTableRowBuilder More...
 
 testDataTableRenderStandardRow (I\Table\DataRow $row)
 testDataTableDataRowFromBuilder More...
 
 testRenderEmptyDataCell ()
 

Private Member Functions

 getRenderer ()
 
 getActionFactory ()
 
 getColumnFactory ()
 
 getDummyRequest ()
 

Additional Inherited Members

- Protected Member Functions inherited from TableTestBase
 buildFieldFactory ()
 
 buildRefinery ()
 
 getViewControlFactory ()
 
 getViewControlContainerFactory ()
 
 getTableFactory ()
 
 getMockStorage ()
 

Detailed Description

Tests for the Renderer of DataTables.

Definition at line 81 of file DataRendererTest.php.

Member Function Documentation

◆ getActionFactory()

DataRendererTest::getActionFactory ( )
private

Definition at line 97 of file DataRendererTest.php.

98  {
99  return new I\Table\Action\Factory();
100  }

◆ getColumnFactory()

DataRendererTest::getColumnFactory ( )
private

Definition at line 102 of file DataRendererTest.php.

References getLanguage().

103  {
104  return new I\Table\Column\Factory(
105  $this->getLanguage()
106  );
107  }
getLanguage()
+ Here is the call graph for this function:

◆ getDataFactory()

DataRendererTest::getDataFactory ( )

Definition at line 121 of file DataRendererTest.php.

121  : Data\Factory
122  {
123  return new Data\Factory();
124  }

◆ getDummyRequest()

DataRendererTest::getDummyRequest ( )
private

Definition at line 109 of file DataRendererTest.php.

110  {
111  $request = $this->createMock(ServerRequestInterface::class);
112  $request
113  ->method("getUri")
114  ->willReturn(new \GuzzleHttp\Psr7\Uri('http://localhost:80'));
115  $request
116  ->method("getQueryParams")
117  ->willReturn([]);
118  return $request;
119  }

◆ getRenderer()

DataRendererTest::getRenderer ( )
private

Definition at line 83 of file DataRendererTest.php.

References getLanguage().

84  {
85  return new DTRenderer(
86  $this->getUIFactory(),
87  $this->getTemplateFactory(),
88  $this->getLanguage(),
89  $this->getJavaScriptBinding(),
90  new ilImagePathResolver(),
91  new \ILIAS\Data\Factory(),
92  new \ILIAS\UI\Help\TextRetriever\Echoing(),
93  $this->getUploadLimitResolver()
94  );
95  }
Interface Observer Contains several chained tasks and infos about them.
getLanguage()
wrapper around the renderer to expose protected functions
Builds data types.
Definition: Factory.php:35
+ Here is the call graph for this function:

◆ getUIFactory()

DataRendererTest::getUIFactory ( )

Definition at line 126 of file DataRendererTest.php.

References ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\button(), and ILIAS\Repository\symbol().

126  : NoUIFactory
127  {
128  $factory = new class ($this->getTableFactory()) extends NoUIFactory {
129  public function __construct(
130  protected I\Table\Factory $table_factory
131  ) {
132  }
133  public function button(): I\Button\Factory
134  {
135  return new I\Button\Factory();
136  }
137  public function dropdown(): I\Dropdown\Factory
138  {
139  return new I\Dropdown\Factory();
140  }
141  public function symbol(): I\Symbol\Factory
142  {
143  return new I\Symbol\Factory(
144  new I\Symbol\Icon\Factory(),
145  new I\Symbol\Glyph\Factory(),
146  new I\Symbol\Avatar\Factory()
147  );
148  }
149  public function table(): I\Table\Factory
150  {
151  return $this->table_factory;
152  }
153  public function divider(): I\Divider\Factory
154  {
155  return new I\Divider\Factory();
156  }
157  };
158  return $factory;
159  }
button(string $caption, string $cmd)
Builds data types.
Definition: Factory.php:35
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

◆ testDataTableDataRowFromBuilder()

DataRendererTest::testDataTableDataRowFromBuilder ( array  $params)

testDataTableRowBuilder

Definition at line 467 of file DataRendererTest.php.

References $params.

467  : I\Table\DataRow
468  {
469  list($rb, $columns, $actions) = $params;
470  $record = [
471  'f1' => 'v1',
472  'f2' => 'v2',
473  'f3' => 3
474  ];
475  $row = $rb->buildDataRow('row_id-1', $record);
476 
477  $this->assertEquals(
478  $columns,
479  $row->getColumns()
480  );
481  $this->assertEquals(
482  $actions,
483  $row->getActions()
484  );
485  $this->assertEquals(
486  $record['f2'],
487  $row->getCellContent('f2')
488  );
489 
490  return $row;
491  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31

◆ testDataTableGetActionRegistration()

DataRendererTest::testDataTableGetActionRegistration ( )

Definition at line 176 of file DataRendererTest.php.

References Vendor\Package\$f, $renderer, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().

177  {
178  $renderer = $this->getRenderer();
179  $f = $this->getActionFactory();
180  $url = $this->getDataFactory()->uri('http://wwww.ilias.de?ref_id=1');
181  $url_builder = new URLBuilder($url);
182  list($builder, $token) = $url_builder->acquireParameter(['namespace'], 'param');
183 
184  $action = $f->standard('label', $builder, $token);
185  $closure = $renderer->p_getActionRegistration('action_id', $action);
186 
187  $actual = $this->brutallyTrimHTML($closure('component_id'));
188  $url = $url->__toString();
189  $expected = $this->brutallyTrimHTML(
190  '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  );
192  $this->assertStringStartsWith($expected, $actual);
193  }
$renderer
$url
Definition: shib_logout.php:66
$token
Definition: xapitoken.php:70
URLBuilder.
Definition: URLBuilder.php:40
+ Here is the call graph for this function:

◆ testDataTableGetMultiActionHandler()

DataRendererTest::testDataTableGetMultiActionHandler ( )

Definition at line 161 of file DataRendererTest.php.

References $renderer.

162  {
163  $renderer = $this->getRenderer();
164  $signal = new I\Signal('signal_id');
165  $closure = $renderer->p_getMultiActionHandler($signal);
166  $actual = $this->brutallyTrimHTML($closure('component_id'));
167  $expected = $this->brutallyTrimHTML(
168  "$(document).on('signal_id', function(event, signal_data) {
169  il.UI.table.data.get('component_id').doMultiAction(signal_data);
170  return false;
171  });"
172  );
173  $this->assertEquals($expected, $actual);
174  }
$renderer

◆ testDataTableMultiActionsDropdown()

DataRendererTest::testDataTableMultiActionsDropdown ( )

Definition at line 195 of file DataRendererTest.php.

References Vendor\Package\$f, $renderer, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().

196  {
197  $renderer = $this->getRenderer();
198  $f = $this->getActionFactory();
199  $signal1 = new I\Signal('signal_id');
200  $signal2 = new I\Signal('signal_id2');
201  $url = $this->getDataFactory()->uri('http://wwww.ilias.de?ref_id=1');
202  $url_builder = new URLBuilder($url);
203  list($builder, $token) = $url_builder->acquireParameter(['namespace'], 'param');
204  $actions = [
205  $f->standard('label1', $builder, $token),
206  $f->standard('label2', $builder, $token)
207  ];
208  $this->assertNull(
209  $renderer->p_buildMultiActionsDropdown([], $signal1, $signal2)
210  );
211  $this->assertEquals(
212  4, //2 actions, 1 divider, one all-action
213  count($renderer->p_buildMultiActionsDropdown($actions, $signal1, $signal2)->getItems())
214  );
215  }
$renderer
$url
Definition: shib_logout.php:66
$token
Definition: xapitoken.php:70
URLBuilder.
Definition: URLBuilder.php:40
+ Here is the call graph for this function:

◆ testDataTableRenderHeaderWithActions()

DataRendererTest::testDataTableRenderHeaderWithActions ( )

Definition at line 388 of file DataRendererTest.php.

References $data, Vendor\Package\$f, ILIAS\UI\Implementation\Component\Table\$range, $renderer, $token, $url, and null.

388  : void
389  {
390  $renderer = $this->getRenderer();
391  $data_factory = new \ILIAS\Data\Factory();
392  $tpl = $this->getTemplateFactory()->getTemplate("components/ILIAS/UI/src/templates/default/Table/tpl.datatable.html", true, true);
393  $f = $this->getColumnFactory();
394 
395  $url = $data_factory->uri('http://wwww.ilias.de?ref_id=1');
396  $url_builder = new URLBuilder($url);
397  list($builder, $token) = $url_builder->acquireParameter(['namespace'], 'param');
398  $actions = [
399  'a2' => $this->getActionFactory()->standard('some action', $builder, $token)
400  ];
401 
402  $data = new class () implements ILIAS\UI\Component\Table\DataRetrieval {
403  public function getRows(
404  Component\Table\DataRowBuilder $row_builder,
405  array $visible_column_ids,
406  Data\Range $range,
407  Data\Order $order,
408  ?array $filter_data,
409  ?array $additional_parameters
410  ): \Generator {
411  yield $row_builder->buldDataRow('', []);
412  }
413  public function getTotalRowCount(
414  ?array $filter_data,
415  ?array $additional_parameters
416  ): ?int {
417  return null;
418  }
419  };
420  $columns = [
421  'f1' => $f->text("Field 1")->withIsSortable(false),
422  ];
423 
424  $sortation_signal = null;
425 
426  $table = $this->getUIFactory()->table()->data($data, '', $columns)
427  ->withActions($actions)
428  ->withRequest($this->getDummyRequest());
429  $renderer->p_renderActionsHeader($this->getDefaultRenderer(), $table, $tpl);
430  $actual = $this->brutallyTrimHTML($tpl->get());
431 
432  $expected = '<th class="c-table-data__header c-table-data__cell c-table-data__header__rowaction" role="columnheader" aria-colindex="1">actions</th>';
433  $this->assertStringContainsString($expected, $actual);
434  }
$renderer
Interface Observer Contains several chained tasks and infos about them.
$url
Definition: shib_logout.php:66
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$token
Definition: xapitoken.php:70
URLBuilder.
Definition: URLBuilder.php:40
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28

◆ testDataTableRenderHeaderWithoutSortableColums()

DataRendererTest::testDataTableRenderHeaderWithoutSortableColums ( )

Definition at line 315 of file DataRendererTest.php.

References $data, Vendor\Package\$f, ILIAS\UI\Implementation\Component\Table\$range, $renderer, ILIAS\Repository\button(), ILIAS\Repository\form(), and null.

315  : void
316  {
317  $renderer = $this->getRenderer();
318  $data_factory = new \ILIAS\Data\Factory();
319  $tpl = $this->getTemplateFactory()->getTemplate("components/ILIAS/UI/src/templates/default/Table/tpl.datatable.html", true, true);
320  $f = $this->getColumnFactory();
321  $data = new class () implements ILIAS\UI\Component\Table\DataRetrieval {
322  public function getRows(
323  Component\Table\DataRowBuilder $row_builder,
324  array $visible_column_ids,
325  Data\Range $range,
326  Data\Order $order,
327  ?array $filter_data,
328  ?array $additional_parameters
329  ): \Generator {
330  yield $row_builder->buldDataRow('', []);
331  }
332  public function getTotalRowCount(
333  ?array $filter_data,
334  ?array $additional_parameters
335  ): ?int {
336  return null;
337  }
338  };
339  $columns = [
340  'f1' => $f->text("Field 1")->withIsSortable(false),
341  'f2' => $f->text("Field 2")->withIsSortable(false)
342  ];
343 
344  $sortation_signal = null;
345 
346  $table = $this->getUIFactory()->table()->data($data, '', $columns)
347  ->withRequest($this->getDummyRequest());
348  $renderer->p_renderTableHeader($this->getDefaultRenderer(), $table, $tpl, $sortation_signal);
349  $actual = $this->brutallyTrimHTML($tpl->get());
350  $expected = <<<EOT
351 <div class="c-table-data" id="{ID}">
352  <div class="viewcontrols">{VIEW_CONTROLS}</div>
353  <div class="c-table-data__table-wrapper">
354  <table class="c-table-data__table" role="grid" aria-labelledby="{ID}_label" aria-colcount="{COL_COUNT}">
355  <thead>
356  <tr class="c-table-data__header c-table-data__row" role="rowgroup">
357  <th class="c-table-data__header c-table-data__cell c-table-data__cell--text" role="columnheader" tabindex="-1" aria-colindex="0">
358  <div class="c-table-data__header__resize-wrapper">Field 1</div>
359  </th>
360  <th class="c-table-data__header c-table-data__cell c-table-data__cell--text" role="columnheader" tabindex="-1" aria-colindex="1">
361  <div class="c-table-data__header__resize-wrapper">Field 2</div>
362  </th>
363  </tr>
364  </thead>
365  <tbody class="c-table-data__body" role="rowgroup"></tbody>
366  </table>
367  </div>
368 
369  <div class="c-table-data__async_modal_container"></div>
370 
371  <dialog class="c-table-data__async_message c-modal" id="{ID}_msgmodal">
372  <div class="modal-dialog" role="document">
373  <div class="modal-content">
374  <div class="modal-header">
375  <form><button formmethod="dialog" class="close" aria-label="close"><span aria-hidden="true">&times;</span></button></form>
376  </div>
377  <div class="c-table-data__async_messageresponse modal-body"></div>
378  </div>
379  </div>
380  </dialog>
381 
382 </div>
383 EOT;
384  $expected = $this->brutallyTrimHTML($expected);
385  $this->assertEquals($expected, $actual);
386  }
button(string $caption, string $cmd)
$renderer
Interface Observer Contains several chained tasks and infos about them.
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
form( $class_path, string $cmd, string $submit_caption="")
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
+ Here is the call graph for this function:

◆ testDataTableRenderStandardRow()

DataRendererTest::testDataTableRenderStandardRow ( I\Table\DataRow  $row)

testDataTableDataRowFromBuilder

Definition at line 496 of file DataRendererTest.php.

References ILIAS\Repository\button().

497  {
498  $actual = $this->brutallyTrimHTML($this->getDefaultRenderer()->render($row));
499  $expected = <<<EOT
500 <td class="c-table-data__cell c-table-data__rowselection" role="gridcell" tabindex="-1">
501  <input type="checkbox" value="row_id-1" class="c-table-data__row-selector">
502 </td>
503 <td class="c-table-data__cell c-table-data__cell--text " role="gridcell" aria-colindex="1" tabindex="-1">
504  <span class="c-table-data__cell__col-title">Field 1:</span>v1
505 </td>
506 <td class="c-table-data__cell c-table-data__cell--text " role="gridcell" aria-colindex="2" tabindex="-1">
507  <span class="c-table-data__cell__col-title">Field 2:</span>v2
508 </td>
509 <td class="c-table-data__cell c-table-data__cell--number " role="gridcell" aria-colindex="3" tabindex="-1">
510  <span class="c-table-data__cell__col-title">Field 3:</span>3
511 </td>
512 <td class="c-table-data__cell c-table-data__rowaction" role="gridcell" tabindex="-1">
513  <div class="dropdown" id="id_3">
514  <button class="btn btn-default dropdown-toggle" type="button" aria-label="actions" aria-haspopup="true" aria-expanded="false" aria-controls="id_3_menu"><span class="caret"></span></button>
515  <ul id="id_3_menu" class="dropdown-menu">
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_1">label1</button></li>
517  <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>
518  </ul>
519  </div>
520 </td>
521 EOT;
522  $expected = $this->brutallyTrimHTML($expected);
523  $this->assertEquals($expected, $actual);
524  }
button(string $caption, string $cmd)
+ Here is the call graph for this function:

◆ testDataTableRenderTableHeader()

DataRendererTest::testDataTableRenderTableHeader ( )

Definition at line 233 of file DataRendererTest.php.

References $data, Vendor\Package\$f, ILIAS\UI\Implementation\Component\Table\$range, $renderer, ILIAS\Repository\button(), ILIAS\Repository\form(), null, and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

234  {
235  $renderer = $this->getRenderer();
236  $data_factory = new \ILIAS\Data\Factory();
237  $tpl = $this->getTemplateFactory()->getTemplate("components/ILIAS/UI/src/templates/default/Table/tpl.datatable.html", true, true);
238  $f = $this->getColumnFactory();
239  $data = new class () implements ILIAS\UI\Component\Table\DataRetrieval {
240  public function getRows(
241  Component\Table\DataRowBuilder $row_builder,
242  array $visible_column_ids,
243  Data\Range $range,
244  Data\Order $order,
245  ?array $filter_data,
246  ?array $additional_parameters
247  ): \Generator {
248  yield $row_builder->buldDataRow('', []);
249  }
250  public function getTotalRowCount(
251  ?array $filter_data,
252  ?array $additional_parameters
253  ): ?int {
254  return null;
255  }
256  };
257  $columns = [
258  'f1' => $f->text("Field 1")->withIndex(1),
259  'f2' => $f->text("Field 2")->withIndex(2)->withIsSortable(false),
260  'f3' => $f->number("Field 3")->withIndex(3)
261  ];
262  $sortation_signal = new I\Signal('sort_header_signal_id');
263  $sortation_signal->addOption('value', 'f1:ASC');
264  $table = $this->getUIFactory()->table()->data($data, '', $columns)
265  ->withRequest($this->getDummyRequest());
266  $renderer->p_renderTableHeader($this->getDefaultRenderer(), $table, $tpl, $sortation_signal);
267 
268  $actual = $this->brutallyTrimHTML($tpl->get());
269  $expected = <<<EOT
270 <div class="c-table-data" id="{ID}">
271  <div class="viewcontrols">{VIEW_CONTROLS}</div>
272  <div class="c-table-data__table-wrapper">
273  <table class="c-table-data__table" role="grid" aria-labelledby="{ID}_label" aria-colcount="{COL_COUNT}">
274  <thead>
275  <tr class="c-table-data__header c-table-data__row" role="rowgroup">
276  <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">
277  <div class="c-table-data__header__resize-wrapper">
278  <a tabindex="0" class="glyph" href="#" aria-label="sort_ascending" id="id_2"><span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span></a>
279  <button class="btn btn-link" id="id_1">Field 1</button>
280  </div>
281  </th>
282  <th class="c-table-data__header c-table-data__cell c-table-data__cell--text" role="columnheader" tabindex="-1" aria-colindex="1">
283  <div class="c-table-data__header__resize-wrapper">Field 2</div>
284  </th>
285  <th class="c-table-data__header c-table-data__cell c-table-data__cell--number" role="columnheader" tabindex="-1" aria-colindex="2">
286  <div class="c-table-data__header__resize-wrapper">
287  <button class="btn btn-link" id="id_3">Field 3</button>
288  </div>
289  </th>
290  </tr>
291  </thead>
292  <tbody class="c-table-data__body" role="rowgroup"></tbody>
293  </table>
294  </div>
295  <div class="c-table-data__async_modal_container"></div>
296 
297  <dialog class="c-table-data__async_message c-modal" id="{ID}_msgmodal">
298  <div class="modal-dialog" role="document">
299  <div class="modal-content">
300  <div class="modal-header">
301  <form><button formmethod="dialog" class="close" aria-label="close"><span aria-hidden="true">&times;</span></button></form>
302  </div>
303  <div class="c-table-data__async_messageresponse modal-body"></div>
304  </div>
305  </div>
306  </dialog>
307 
308 </div>
309 EOT;
310  $expected = $this->brutallyTrimHTML($expected);
311  $this->assertEquals($expected, $actual);
312  }
button(string $caption, string $cmd)
$renderer
Interface Observer Contains several chained tasks and infos about them.
sort()
description: > Example for rendering a Sort Glyph.
Definition: sort.php:41
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
form( $class_path, string $cmd, string $submit_caption="")
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
+ Here is the call graph for this function:

◆ testDataTableRowBuilder()

DataRendererTest::testDataTableRowBuilder ( )

Definition at line 436 of file DataRendererTest.php.

References Vendor\Package\$f, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().

437  {
438  $f = $this->getColumnFactory();
439  $columns = [
440  'f1' => $f->text("Field 1")->withIndex(1),
441  'f2' => $f->text("Field 2")->withIndex(2),
442  'f3' => $f->number("Field 3")->withIndex(3)
443  ];
444  $f = $this->getActionFactory();
445  $url = $this->getDataFactory()->uri('http://wwww.ilias.de?ref_id=1');
446  $url_builder = new URLBuilder($url);
447  list($builder, $token) = $url_builder->acquireParameter(['namespace'], 'param');
448  $actions = [
449  'a1' => $f->standard('label1', $builder, $token)->withAsync(),
450  'a2' => $f->standard('label2', $builder, $token)
451  ];
452 
453  $rb = (new I\Table\DataRowBuilder())
454  ->withMultiActionsPresent(true)
455  ->withSingleActions($actions)
456  ->withVisibleColumns($columns);
457 
458  $row = $rb->buildDataRow('row_id-1', []);
459  $this->assertInstanceOf(Component\Table\DataRow::class, $row);
460 
461  return [$rb, $columns, $actions];
462  }
$url
Definition: shib_logout.php:66
$token
Definition: xapitoken.php:70
URLBuilder.
Definition: URLBuilder.php:40
+ Here is the call graph for this function:

◆ testDataTableSingleActionsDropdown()

DataRendererTest::testDataTableSingleActionsDropdown ( )

Definition at line 216 of file DataRendererTest.php.

References Vendor\Package\$f, $renderer, $token, $url, and ILIAS\UI\Implementation\Component\Input\getDataFactory().

217  {
218  $renderer = $this->getRenderer();
219  $f = $this->getActionFactory();
220  $url = $this->getDataFactory()->uri('http://wwww.ilias.de?ref_id=1');
221  $url_builder = new URLBuilder($url);
222  list($builder, $token) = $url_builder->acquireParameter(['namespace'], 'param');
223  $actions = [
224  'a1' => $f->standard('label1', $builder, $token)->withAsync(),
225  'a2' => $f->standard('label2', $builder, $token)
226  ];
227  $this->assertEquals(
228  2,
229  count($renderer->p_getSingleActionsForRow('row_id-1', $actions)->getItems())
230  );
231  }
$renderer
$url
Definition: shib_logout.php:66
$token
Definition: xapitoken.php:70
URLBuilder.
Definition: URLBuilder.php:40
+ Here is the call graph for this function:

◆ testRenderEmptyDataCell()

DataRendererTest::testRenderEmptyDataCell ( )

Definition at line 526 of file DataRendererTest.php.

References $data, ILIAS\UI\Implementation\Component\Table\$range, ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\from(), and getLanguage().

526  : void
527  {
528  $data = new class () implements Component\Table\DataRetrieval {
529  public function getRows(
530  Component\Table\DataRowBuilder $row_builder,
531  array $visible_column_ids,
532  Data\Range $range,
533  Data\Order $order,
534  ?array $filter_data,
535  ?array $additional_parameters
536  ): Generator {
537  yield from [];
538  }
539 
540  public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int
541  {
542  return 0;
543  }
544  };
545 
546  $columns = [
547  'f1' => $this->getUIFactory()->table()->column()->text('f1'),
548  'f2' => $this->getUIFactory()->table()->column()->text('f2'),
549  'f3' => $this->getUIFactory()->table()->column()->text('f3'),
550  'f4' => $this->getUIFactory()->table()->column()->text('f4'),
551  'f5' => $this->getUIFactory()->table()->column()->text('f5'),
552  ];
553 
554  $table = $this->getTableFactory()->data($data, '', $columns)
555  ->withRequest($this->getDummyRequest());
556 
557  $html = $this->getDefaultRenderer()->render($table);
558 
559  $translation = $this->getLanguage()->txt('ui_table_no_records');
560  $column_count = count($columns);
561 
562  // check that the empty cell is stretched over all columns.
563  $this->assertTrue(str_contains($html, "colspan=\"$column_count\""));
564  // check that the cell contains the default message.
565  $this->assertTrue(str_contains($html, $translation));
566  }
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
getLanguage()
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: