ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SystemInfoTest Class Reference

Class SystemInfoTest. More...

+ Inheritance diagram for SystemInfoTest:
+ Collaboration diagram for SystemInfoTest:

Public Member Functions

 setUp ()
 
 testRenderingDefault ()
 
 testRenderingNeutral ()
 
 testRenderingImportant ()
 
 testRenderingBreaking ()
 
 testRenderingCloseAction ()
 
 getDefaultRenderer (?JavaScriptBinding $js_binding=null, array $with_stub_renderings=[], array $with_additional_contexts=[],)
 
 getUIFactory ()
 

Private Attributes

SignalGenerator $sig_gen
 

Detailed Description

Class SystemInfoTest.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 35 of file SystemInfoTest.php.

Member Function Documentation

◆ getDefaultRenderer()

SystemInfoTest::getDefaultRenderer ( ?JavaScriptBinding  $js_binding = null,
array  $with_stub_renderings = [],
array  $with_additional_contexts = [] 
)

Definition at line 210 of file SystemInfoTest.php.

215 return parent::getDefaultRenderer(new class () implements JavaScriptBinding {
216 public function createId(): string
217 {
218 return "id";
219 }
220
221 public array $on_load_code = array();
222
223 public function addOnLoadCode(string $code): void
224 {
225 $this->on_load_code[] = $code;
226 }
227
228 public function getOnLoadCodeAsync(): string
229 {
230 }
231 });
232 }
Provides methods to interface with javascript.

Referenced by testRenderingBreaking(), testRenderingCloseAction(), testRenderingDefault(), testRenderingImportant(), and testRenderingNeutral().

+ Here is the caller graph for this function:

◆ getUIFactory()

SystemInfoTest::getUIFactory ( )

Definition at line 234 of file SystemInfoTest.php.

235 {
236 $factory = new class () extends NoUIFactory {
238
239 public function __construct()
240 {
241 $this->sig_gen = new SignalGenerator();
242 }
243
244 public function symbol(): ILIAS\UI\Implementation\Component\Symbol\Factory
245 {
246 return new Factory(
247 new \ILIAS\UI\Implementation\Component\Symbol\Icon\Factory(),
248 new \ILIAS\UI\Implementation\Component\Symbol\Glyph\Factory(),
249 new \ILIAS\UI\Implementation\Component\Symbol\Avatar\Factory()
250 );
251 }
252
253 public function mainControls(): \ILIAS\UI\Implementation\Component\MainControls\Factory
254 {
255 return new \ILIAS\UI\Implementation\Component\MainControls\Factory(
256 $this->sig_gen,
257 new \ILIAS\UI\Implementation\Component\MainControls\Slate\Factory(
258 $this->sig_gen,
259 new \ILIAS\UI\Implementation\Component\Counter\Factory(),
260 $this->symbol()
261 )
262 );
263 }
264 };
265 $factory->sig_gen = $this->sig_gen;
266
267 return $factory;
268 }
SignalGenerator $sig_gen
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

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

+ Here is the call graph for this function:

◆ setUp()

SystemInfoTest::setUp ( )

Definition at line 39 of file SystemInfoTest.php.

39 : void
40 {
41 parent::setUp();
42 $this->sig_gen = new SignalGenerator();
43 }

◆ testRenderingBreaking()

SystemInfoTest::testRenderingBreaking ( )

Definition at line 142 of file SystemInfoTest.php.

142 : void
143 {
144 $headline = 'That\'s one small step for [a] man';
145 $information = 'Lorem IPsum dolor sit amet';
146 $r = $this->getDefaultRenderer();
147 $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
148 ->withDenotation(SystemInfoAlias::DENOTATION_BREAKING);
149
150 // Breaking
151 $expected = <<<EOT
152<div id="id" class="container-fluid il-system-info il-system-info-breaking" data-close-uri="" role="alert" aria-labelledby="id_headline" aria-describedby="id_description">
153 <div class="il-system-info-content-wrapper">
154 <div class="il-system-info-content">
155 <div id="id_headline" class="il-system-info-headline">$headline</div>
156 <div id="id_description" class="il-system-info-body">$information</div>
157 </div>
158 </div>
159 <div class="il-system-info-actions">
160 <span class="il-system-info-more">
161 <a tabindex="0" class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
162 </span>
163 <span class="il-system-info-close"></span>
164 </div>
165</div>
166EOT;
167
168 $actual = $r->render($system_info);
169 $this->assertEquals(
170 $this->brutallyTrimHTML($expected),
171 $this->brutallyTrimHTML($actual)
172 );
173 }
getDefaultRenderer(?JavaScriptBinding $js_binding=null, array $with_stub_renderings=[], array $with_additional_contexts=[],)

References ILIAS\UI\examples\Symbol\Glyph\Close\close(), and getDefaultRenderer().

+ Here is the call graph for this function:

◆ testRenderingCloseAction()

SystemInfoTest::testRenderingCloseAction ( )

Definition at line 176 of file SystemInfoTest.php.

176 : void
177 {
178 $headline = 'That\'s one small step for [a] man';
179 $information = 'Lorem IPsum dolor sit amet';
180 $uri_string = 'http://one_giant_leap?for=mankind';
181 $action = new URI($uri_string);
182 $r = $this->getDefaultRenderer();
183 $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
184 ->withDismissAction($action);
185
186 $expected = <<<EOT
187<div id="id" class="container-fluid il-system-info il-system-info-neutral" data-close-uri="$uri_string" aria-live="polite" aria-labelledby="id_headline" aria-describedby="id_description">
188 <div class="il-system-info-content-wrapper">
189 <div class="il-system-info-content">
190 <div id="id_headline" class="il-system-info-headline">$headline</div>
191 <div id="id_description" class="il-system-info-body">$information</div>
192 </div>
193 </div>
194 <div class="il-system-info-actions">
195 <span class="il-system-info-more">
196 <a tabindex="0" class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
197 </span>
198 <span class="il-system-info-close"><a tabindex="0" class="glyph" href="#" aria-label="close" id="id"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></span>
199 </div>
200</div>
201EOT;
202
203 $actual = $r->render($system_info);
204 $this->assertEquals(
205 $this->brutallyTrimHTML($expected),
206 $this->brutallyTrimHTML($actual)
207 );
208 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35

References ILIAS\UI\examples\Symbol\Glyph\Close\close(), and getDefaultRenderer().

+ Here is the call graph for this function:

◆ testRenderingDefault()

SystemInfoTest::testRenderingDefault ( )

Definition at line 45 of file SystemInfoTest.php.

45 : void
46 {
47 $headline = 'That\'s one small step for [a] man';
48 $information = 'Lorem IPsum dolor sit amet';
49 $r = $this->getDefaultRenderer();
50 $system_info = new SystemInfo($this->sig_gen, $headline, $information);
51
52 // Neutral
53 $expected = <<<EOT
54<div id="id" class="container-fluid il-system-info il-system-info-neutral" data-close-uri="" aria-live="polite" aria-labelledby="id_headline" aria-describedby="id_description">
55 <div class="il-system-info-content-wrapper">
56 <div class="il-system-info-content">
57 <div id="id_headline" class="il-system-info-headline">$headline</div>
58 <div id="id_description" class="il-system-info-body">$information</div>
59 </div>
60 </div>
61 <div class="il-system-info-actions">
62 <span class="il-system-info-more">
63 <a tabindex="0" class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
64 </span>
65 <span class="il-system-info-close"></span>
66 </div>
67</div>
68EOT;
69
70 $actual = $r->render($system_info);
71 $this->assertEquals(
72 $this->brutallyTrimHTML($expected),
73 $this->brutallyTrimHTML($actual)
74 );
75 }

References ILIAS\UI\examples\Symbol\Glyph\Close\close(), and getDefaultRenderer().

+ Here is the call graph for this function:

◆ testRenderingImportant()

SystemInfoTest::testRenderingImportant ( )

Definition at line 110 of file SystemInfoTest.php.

110 : void
111 {
112 $headline = 'That\'s one small step for [a] man';
113 $information = 'Lorem IPsum dolor sit amet';
114 $r = $this->getDefaultRenderer();
115 $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
116 ->withDenotation(SystemInfoAlias::DENOTATION_IMPORTANT);
117
118 $actual = $r->render($system_info);
119 $expected = <<<EOT
120<div id="id" class="container-fluid il-system-info il-system-info-important" data-close-uri="" aria-live="polite" aria-labelledby="id_headline" aria-describedby="id_description">
121 <div class="il-system-info-content-wrapper">
122 <div class="il-system-info-content">
123 <div id="id_headline" class="il-system-info-headline">$headline</div>
124 <div id="id_description" class="il-system-info-body">$information</div>
125 </div>
126 </div>
127 <div class="il-system-info-actions">
128 <span class="il-system-info-more">
129 <a tabindex="0" class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
130 </span>
131 <span class="il-system-info-close"></span>
132 </div>
133</div>
134EOT;
135
136 $this->assertEquals(
137 $this->brutallyTrimHTML($expected),
138 $this->brutallyTrimHTML($actual)
139 );
140 }

References ILIAS\UI\examples\Symbol\Glyph\Close\close(), and getDefaultRenderer().

+ Here is the call graph for this function:

◆ testRenderingNeutral()

SystemInfoTest::testRenderingNeutral ( )

Definition at line 77 of file SystemInfoTest.php.

77 : void
78 {
79 $headline = 'That\'s one small step for [a] man';
80 $information = 'Lorem IPsum dolor sit amet';
81 $r = $this->getDefaultRenderer();
82 $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
83 ->withDenotation(SystemInfoAlias::DENOTATION_NEUTRAL);
84
85 // Neutral
86 $expected = <<<EOT
87<div id="id" class="container-fluid il-system-info il-system-info-neutral" data-close-uri="" aria-live="polite" aria-labelledby="id_headline" aria-describedby="id_description">
88 <div class="il-system-info-content-wrapper">
89 <div class="il-system-info-content">
90 <div id="id_headline" class="il-system-info-headline">$headline</div>
91 <div id="id_description" class="il-system-info-body">$information</div>
92 </div>
93 </div>
94 <div class="il-system-info-actions">
95 <span class="il-system-info-more">
96 <a tabindex="0" class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
97 </span>
98 <span class="il-system-info-close"></span>
99 </div>
100</div>
101EOT;
102
103 $actual = $r->render($system_info);
104 $this->assertEquals(
105 $this->brutallyTrimHTML($expected),
106 $this->brutallyTrimHTML($actual)
107 );
108 }

References ILIAS\UI\examples\Symbol\Glyph\Close\close(), and getDefaultRenderer().

+ Here is the call graph for this function:

Field Documentation

◆ $sig_gen

SignalGenerator SystemInfoTest::$sig_gen
private

Definition at line 37 of file SystemInfoTest.php.


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