19 declare(strict_types=1);
    21 require_once(
"vendor/composer/vendor/autoload.php");
    22 require_once(__DIR__ . 
"/TableTestBase.php");
    39         return new C\Table\Factory(
    40             new C\SignalGenerator(),
    44             new C\Table\DataRowBuilder(),
    45             new C\Table\OrderingRowBuilder()
    52             public function getRows(
    53                 I\Table\DataRowBuilder $row_builder,
    54                 array $visible_column_ids,
    58                 ?array $additional_parameters
    60                 yield $row_builder->buildStandardRow(
'', []);
    62             public function getTotalRowCount(
    64                 ?array $additional_parameters
    76         $this->assertInstanceOf(Order::class, $table->getOrder());
    77         $this->assertInstanceOf(Range::class, $table->getRange());
    78         $this->assertInstanceOf(
I\Signal::class, $table->getAsyncActionSignal());
    79         $this->assertInstanceOf(
I\Signal::class, $table->getMultiActionSignal());
    80         $this->assertInstanceOf(
I\Signal::class, $table->getSelectionSignal());
    81         $this->assertFalse($table->hasSingleActions());
    82         $this->assertFalse($table->hasMultiActions());
    83         $this->assertEquals(
$data, $table->getDataRetrieval());
    88         $this->expectException(\InvalidArgumentException::class);
    90         $cols = [
'f0' => 
"col1"];
    96         $this->expectException(\InvalidArgumentException::class);
   106             'f0' => 
$f->text(
"col1"),
   107             'f1' => 
$f->text(
"col2")
   111         $this->assertEquals(2, $table->getColumnCount());
   113             'f0' => 
$f->text(
"col1")->withIndex(0),
   114             'f1' => 
$f->text(
"col2")->withIndex(1)
   116         $this->assertEquals($check, $table->getColumns());
   117         $this->assertEquals($check, $table->getVisibleColumns());
   123         $df = new \ILIAS\Data\Factory();
   124         $target = $df->uri(
'http://wwww.ilias.de?ref_id=1');
   126         list($builder, 
$token) = $url_builder->acquireParameter([
'namespace'], 
'rowids');
   128             $f->single(
'act1', $builder, 
$token),
   129             $f->multi(
'act2', $builder, 
$token),
   130             $f->standard(
'act0', $builder, 
$token)
   134             ->withActions($actions);
   136         $this->assertEquals($actions, $table->getAllActions());
   137         $this->assertEqualsCanonicalizing([$actions[0], $actions[2]], $table->getSingleActions());
   138         $this->assertEqualsCanonicalizing([$actions[1], $actions[2]], $table->getMultiActions());
   152         $request = $this->createMock(ServerRequestInterface::class);
   153         $this->assertEquals($request, $table->withRequest($request)->getRequest());
   159         $order = 
new Order(
'aspect', 
'DESC');
   160         $this->assertEquals($order, $table->withOrder($order)->getOrder());
   167         $this->assertEquals(
$range, $table->withRange(
$range)->getRange());
   174             'aspect' => [
'values']
   176         $this->assertEquals($filter, $table->withFilter($filter)->getFilter());
   185         $this->assertEquals(
$params, $table->withAdditionalParameters(
$params)->getAdditionalParameters());
   194                 ->withIsOptional(
true, 
false),
   198         $this->assertEquals(3, $table->getColumnCount());
   199         $this->assertEquals([
'f0', 
'f2'], array_keys($table->getVisibleColumns()));
   200         $this->assertEquals(0, $table->getVisibleColumns()[
'f0']->getIndex());
   201         $this->assertEquals(2, $table->getVisibleColumns()[
'f2']->getIndex());
   206         $table = 
new class () extends 
C\Table\
Data {
   210             public function mockGetStorageId(): ?
string   212                 return $this->getStorageId();
   214             public function mockGetId(): ?
string   216                 return $this->
getId();
   220         $this->assertNull($table->mockGetId());
   221         $this->assertNull($table->mockGetStorageId());
   223         $table_id = 
'some_id';
   224         $internal_table_id = C\Table\Data::STORAGE_ID_PREFIX . $table_id;
   225         $table = $table->withId($table_id);
   226         $this->assertEquals($table_id, $table->mockGetId());
   227         $this->assertEquals($internal_table_id, $table->mockGetStorageId());
   232         $table_id = 
'some_id';
   233         $internal_table_id = C\Table\Data::STORAGE_ID_PREFIX . $table_id;
   234         $table_data = [
'a' => 
'b'];
   236         $storage[$internal_table_id] = $table_data;
   238         $table = 
new class ($storage) extends 
C\Table\
Data {
   243             public function mockGetStorageData(): ?array
   245                 return $this->getStorageData();
   249         $table = $table->withId($table_id);
   250         $this->assertEquals($table_data, $table->mockGetStorageData());
 
testDataTableWithAdditionalParams()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
testDataTableConstructionWithErrorColumns()
 
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
 
Interface Observer  Contains several chained tasks and infos about them. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
testDataTableBasicConstruction()
 
testDataTableConstructionWithoutColumns()
 
Both the subject and the direction need to be specified when expressing an order. ...
 
testDataTableWithSelectedOptionalCols()
 
testDataTableWithFilter()
 
testDataTableWithIdAndStorage()
 
testDataTableWithRequest()
 
Tests for the Data Table. 
 
__construct(Container $dic, ilPlugin $plugin)
 
A simple class to express a naive range of whole positive numbers. 
 
Basic Tests for all Tables.