ILIAS  release_8 Revision v8.24
TableTestBase.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once("libs/composer/vendor/autoload.php");
22require_once(__DIR__ . "/../../Base.php");
23
28use ILIAS\Refinery\Factory as Refinery;
30
34abstract class TableTestBase extends ILIAS_UI_TestBase
35{
36 protected function buildFieldFactory(): FieldFactory
37 {
38 return new FieldFactory(
39 $this->createMock(UploadLimitResolver::class),
40 new C\SignalGenerator(),
41 new \ILIAS\Data\Factory(),
42 $this->buildRefinery(),
43 $this->getLanguage()
44 );
45 }
46
47 protected function buildRefinery(): Refinery
48 {
49 return new Refinery(
50 new \ILIAS\Data\Factory(),
51 $this->createMock(ilLanguage::class)
52 );
53 }
54
56 {
57 return new ViewControl\Factory(
58 $this->buildFieldFactory(),
59 new \ILIAS\Data\Factory(),
60 $this->buildRefinery(),
61 new C\SignalGenerator(),
62 $this->getLanguage(),
63 );
64 }
65
67 {
69 new C\SignalGenerator(),
70 $this->getViewControlFactory(),
71 );
72 }
73
74 protected function getTableFactory(): C\Table\Factory
75 {
76 return new C\Table\Factory(
77 new C\SignalGenerator(),
78 $this->getViewControlFactory(),
80 new \ILIAS\Data\Factory(),
81 new C\Table\Column\Factory($this->getLanguage()),
82 new C\Table\Action\Factory(),
83 new C\Table\DataRowBuilder(),
84 $this->getMockStorage()
85 );
86 }
87
88 protected function getMockStorage(): ArrayAccess
89 {
90 return new class () implements ArrayAccess {
91 protected array $data = [];
92 public function offsetExists($offset)
93 {
94 return isset($this->data[$offset]);
95 }
96 public function offsetGet($offset)
97 {
98 if(!$this->offsetExists($offset)) {
99 return null;
100 }
101 return $this->data[$offset];
102 }
103 public function offsetSet($offset, $value)
104 {
105 $this->data[$offset] = $value;
106 }
107 public function offsetUnset($offset)
108 {
109 unset($this->data[$offset]);
110 }
111 };
112 }
113}
Factory for Date Formats.
Definition: Factory.php:27
Builds data types.
Definition: Factory.php:21
Provides common functionality for UI tests.
Definition: Base.php:299
Basic Tests for all Tables.
getViewControlContainerFactory()
This is what a factory for View Control Containers looks like.
Definition: Factory.php:27
This is how the factory for UI elements looks.
Definition: Factory.php:31
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...
Definition: Factory.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.