ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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, $with_stub_renderings=[])
 
 getUIFactory ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Private Attributes

 $sig_gen
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML ($html)
 A more radical version of normalizeHTML. More...
 

Detailed Description

Class SystemInfoTest.

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

Definition at line 16 of file SystemInfoTest.php.

Member Function Documentation

◆ getDefaultRenderer()

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

Definition at line 195 of file SystemInfoTest.php.

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

196  {
197  return parent::getDefaultRenderer(new class implements \ILIAS\UI\Implementation\Render\JavaScriptBinding {
198  public function createId()
199  {
200  return "id";
201  }
202 
203  public $on_load_code = array();
204 
205  public function addOnLoadCode($code)
206  {
207  $this->on_load_code[] = $code;
208  }
209 
210  public function getOnLoadCodeAsync()
211  {
212  }
213  });
214  }
Class Factory.
Class ChatMainBarProvider .
Provides methods to interface with javascript.
+ Here is the caller graph for this function:

◆ getUIFactory()

SystemInfoTest::getUIFactory ( )

Definition at line 216 of file SystemInfoTest.php.

References $factory, $sig_gen, and ILIAS\GlobalScreen\Provider\__construct().

217  {
218  $factory = new class() extends NoUIFactory {
219 
223  public function __construct()
224  {
225  $this->sig_gen = new SignalGenerator();
226  }
227 
228  public function symbol() : ILIAS\UI\Component\Symbol\Factory
229  {
230  return new Factory(
231  new \ILIAS\UI\Implementation\Component\Symbol\Icon\Factory(),
232  new \ILIAS\UI\Implementation\Component\Symbol\Glyph\Factory(),
233  new \ILIAS\UI\Implementation\Component\Symbol\Avatar\Factory()
234  );
235  }
236 
237  public function mainControls() : \ILIAS\UI\Component\MainControls\Factory
238  {
239  return new \ILIAS\UI\Implementation\Component\MainControls\Factory(
240  $this->sig_gen,
241  new \ILIAS\UI\Implementation\Component\MainControls\Slate\Factory(
242  $this->sig_gen,
243  new \ILIAS\UI\Implementation\Component\Counter\Factory(),
244  $this->symbol()
245  )
246  );
247  }
248  };
249  $factory->sig_gen = $this->sig_gen;
250 
251  return $factory;
252  }
Class Factory.
Class ChatMainBarProvider .
__construct(Container $dic, ilPlugin $plugin)
$factory
Definition: metadata.php:58
+ Here is the call graph for this function:

◆ setUp()

SystemInfoTest::setUp ( )

Definition at line 24 of file SystemInfoTest.php.

24  : void
25  {
26  parent::setUp();
27  $this->sig_gen = new SignalGenerator();
28  }

◆ testRenderingBreaking()

SystemInfoTest::testRenderingBreaking ( )

Definition at line 127 of file SystemInfoTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), close(), and getDefaultRenderer().

128  {
129  $headline = 'That\'s one small step for [a] man';
130  $information = 'Lorem IPsum dolor sit amet';
131  $r = $this->getDefaultRenderer();
132  $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
133  ->withDenotation(SystemInfo::DENOTATION_BREAKING);
134 
135  // Breaking
136  $expected = <<<EOT
137 <div id="id" class="container-fluid il-system-info il-system-info-breaking" data-close-uri="" role="alert" aria-labelledby="il-system-info-headline" aria-describedby="il-system-info-headline">
138  <div class="il-system-info-content-wrapper">
139  <div class="il-system-info-content">
140  <span class="il-system-info-headline">$headline</span>
141  <span class="il-system-info-body">$information</span>
142  </div>
143  </div>
144  <div class="il-system-info-actions">
145  <span class="il-system-info-more">
146  <a class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
147  </span>
148  <span class="il-system-info-close"></span>
149  </div>
150 </div>
151 EOT;
152 
153  $actual = $r->render($system_info);
154  $this->assertEquals(
155  $this->brutallyTrimHTML($expected),
156  $this->brutallyTrimHTML($actual)
157  );
158  }
close()
Definition: close.php:2
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:392
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
+ Here is the call graph for this function:

◆ testRenderingCloseAction()

SystemInfoTest::testRenderingCloseAction ( )

Definition at line 161 of file SystemInfoTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), close(), and getDefaultRenderer().

162  {
163  $headline = 'That\'s one small step for [a] man';
164  $information = 'Lorem IPsum dolor sit amet';
165  $uri_string = 'http://one_giant_leap?for=mankind';
166  $action = new URI($uri_string);
167  $r = $this->getDefaultRenderer();
168  $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
169  ->withDismissAction($action);
170 
171  $expected = <<<EOT
172 <div id="id" class="container-fluid il-system-info il-system-info-neutral" data-close-uri="$uri_string" aria-live="polite" aria-labelledby="il-system-info-headline" aria-describedby="il-system-info-headline">
173  <div class="il-system-info-content-wrapper">
174  <div class="il-system-info-content">
175  <span class="il-system-info-headline">$headline</span>
176  <span class="il-system-info-body">$information</span>
177  </div>
178  </div>
179  <div class="il-system-info-actions">
180  <span class="il-system-info-more">
181  <a class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
182  </span>
183  <span class="il-system-info-close"><a class="glyph" href="#" aria-label="close" id="id"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></span>
184  </div>
185 </div>
186 EOT;
187 
188  $actual = $r->render($system_info);
189  $this->assertEquals(
190  $this->brutallyTrimHTML($expected),
191  $this->brutallyTrimHTML($actual)
192  );
193  }
close()
Definition: close.php:2
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:17
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:392
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
+ Here is the call graph for this function:

◆ testRenderingDefault()

SystemInfoTest::testRenderingDefault ( )

Definition at line 30 of file SystemInfoTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), close(), and getDefaultRenderer().

31  {
32  $headline = 'That\'s one small step for [a] man';
33  $information = 'Lorem IPsum dolor sit amet';
34  $r = $this->getDefaultRenderer();
35  $system_info = new SystemInfo($this->sig_gen, $headline, $information);
36 
37  // Neutral
38  $expected = <<<EOT
39 <div id="id" class="container-fluid il-system-info il-system-info-neutral" data-close-uri="" aria-live="polite" aria-labelledby="il-system-info-headline" aria-describedby="il-system-info-headline">
40  <div class="il-system-info-content-wrapper">
41  <div class="il-system-info-content">
42  <span class="il-system-info-headline">$headline</span>
43  <span class="il-system-info-body">$information</span>
44  </div>
45  </div>
46  <div class="il-system-info-actions">
47  <span class="il-system-info-more">
48  <a class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
49  </span>
50  <span class="il-system-info-close"></span>
51  </div>
52 </div>
53 EOT;
54 
55  $actual = $r->render($system_info);
56  $this->assertEquals(
57  $this->brutallyTrimHTML($expected),
58  $this->brutallyTrimHTML($actual)
59  );
60  }
close()
Definition: close.php:2
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:392
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
+ Here is the call graph for this function:

◆ testRenderingImportant()

SystemInfoTest::testRenderingImportant ( )

Definition at line 95 of file SystemInfoTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), close(), and getDefaultRenderer().

96  {
97  $headline = 'That\'s one small step for [a] man';
98  $information = 'Lorem IPsum dolor sit amet';
99  $r = $this->getDefaultRenderer();
100  $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
101  ->withDenotation(SystemInfo::DENOTATION_IMPORTANT);
102 
103  $actual = $r->render($system_info);
104  $expected = <<<EOT
105 <div id="id" class="container-fluid il-system-info il-system-info-important" data-close-uri="" aria-live="polite" aria-labelledby="il-system-info-headline" aria-describedby="il-system-info-headline">
106  <div class="il-system-info-content-wrapper">
107  <div class="il-system-info-content">
108  <span class="il-system-info-headline">$headline</span>
109  <span class="il-system-info-body">$information</span>
110  </div>
111  </div>
112  <div class="il-system-info-actions">
113  <span class="il-system-info-more">
114  <a class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
115  </span>
116  <span class="il-system-info-close"></span>
117  </div>
118 </div>
119 EOT;
120 
121  $this->assertEquals(
122  $this->brutallyTrimHTML($expected),
123  $this->brutallyTrimHTML($actual)
124  );
125  }
close()
Definition: close.php:2
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:392
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
+ Here is the call graph for this function:

◆ testRenderingNeutral()

SystemInfoTest::testRenderingNeutral ( )

Definition at line 62 of file SystemInfoTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), close(), and getDefaultRenderer().

63  {
64  $headline = 'That\'s one small step for [a] man';
65  $information = 'Lorem IPsum dolor sit amet';
66  $r = $this->getDefaultRenderer();
67  $system_info = (new SystemInfo($this->sig_gen, $headline, $information))
68  ->withDenotation(SystemInfo::DENOTATION_NEUTRAL);
69 
70  // Neutral
71  $expected = <<<EOT
72 <div id="id" class="container-fluid il-system-info il-system-info-neutral" data-close-uri="" aria-live="polite" aria-labelledby="il-system-info-headline" aria-describedby="il-system-info-headline">
73  <div class="il-system-info-content-wrapper">
74  <div class="il-system-info-content">
75  <span class="il-system-info-headline">$headline</span>
76  <span class="il-system-info-body">$information</span>
77  </div>
78  </div>
79  <div class="il-system-info-actions">
80  <span class="il-system-info-more">
81  <a class="glyph" href="#" aria-label="show_more"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></a>
82  </span>
83  <span class="il-system-info-close"></span>
84  </div>
85 </div>
86 EOT;
87 
88  $actual = $r->render($system_info);
89  $this->assertEquals(
90  $this->brutallyTrimHTML($expected),
91  $this->brutallyTrimHTML($actual)
92  );
93  }
close()
Definition: close.php:2
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:392
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
+ Here is the call graph for this function:

Field Documentation

◆ $sig_gen

SystemInfoTest::$sig_gen
private

Definition at line 22 of file SystemInfoTest.php.

Referenced by getUIFactory().


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