ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
FooterTest Class Reference

Tests for the Footer. More...

+ Inheritance diagram for FooterTest:
+ Collaboration diagram for FooterTest:

Public Member Functions

 setUp ()
 
 testConstruction ()
 
 testConstructionNoLinks ()
 
 testGetLinks ($footer)
 testConstruction More...
 
 testGetText ($footer)
 testConstruction More...
 
 testPermanentURL ($footer)
 testConstruction More...
 
 getUIFactory ()
 
 testRendering ($footer)
 testConstruction More...
 
 testRenderingNoLinks ($footer)
 testConstructionNoLinks More...
 
 testRenderingPermUrl ($footer)
 testPermanentURL More...
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Protected Member Functions

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

Detailed Description

Tests for the Footer.

Definition at line 14 of file FooterTest.php.

Member Function Documentation

◆ getFactory()

FooterTest::getFactory ( )
protected

Definition at line 27 of file FooterTest.php.

References $factory.

Referenced by testConstruction(), and testConstructionNoLinks().

28  {
29  $sig_gen = new I\SignalGenerator();
30  $sig_gen = new I\SignalGenerator();
31  $counter_factory = new I\Counter\Factory();
32  $slate_factory = new I\MainControls\Slate\Factory(
33  $sig_gen,
34  $counter_factory,
35  new I\Symbol\Factory(
36  new I\Symbol\Icon\Factory(),
37  new I\Symbol\Glyph\Factory(),
38  new I\Symbol\Avatar\Factory()
39  )
40  );
41  $factory = new I\MainControls\Factory($sig_gen, $slate_factory);
42  return $factory;
43  }
$factory
Definition: metadata.php:58
+ Here is the caller graph for this function:

◆ getUIFactory()

FooterTest::getUIFactory ( )

Definition at line 103 of file FooterTest.php.

References $factory.

104  {
105  $factory = new class extends NoUIFactory {
106  public function listing()
107  {
108  return new I\Listing\Factory();
109  }
110  };
111  return $factory;
112  }
$factory
Definition: metadata.php:58

◆ setUp()

FooterTest::setUp ( )

Definition at line 16 of file FooterTest.php.

References Vendor\Package\$f.

16  : void
17  {
18  $f = new I\Link\Factory();
19  $this->links = [
20  $f->standard("Goto ILIAS", "http://www.ilias.de"),
21  $f->standard("go up", "#")
22  ];
23  $this->text = 'footer text';
24  $this->perm_url = 'http://www.ilias.de/goto.php?target=xxx_123';
25  }

◆ testConstruction()

FooterTest::testConstruction ( )

Definition at line 45 of file FooterTest.php.

References getFactory().

46  {
47  $footer = $this->getFactory()->footer($this->links, $this->text);
48  $this->assertInstanceOf(
49  "ILIAS\\UI\\Component\\MainControls\\Footer",
50  $footer
51  );
52  return $footer;
53  }
+ Here is the call graph for this function:

◆ testConstructionNoLinks()

FooterTest::testConstructionNoLinks ( )

Definition at line 55 of file FooterTest.php.

References getFactory().

56  {
57  $footer = $this->getFactory()->footer([], $this->text);
58  $this->assertInstanceOf(
59  "ILIAS\\UI\\Component\\MainControls\\Footer",
60  $footer
61  );
62  return $footer;
63  }
+ Here is the call graph for this function:

◆ testGetLinks()

FooterTest::testGetLinks (   $footer)

testConstruction

Definition at line 68 of file FooterTest.php.

69  {
70  $this->assertEquals(
71  $this->links,
72  $footer->getLinks()
73  );
74  }

◆ testGetText()

FooterTest::testGetText (   $footer)

testConstruction

Definition at line 79 of file FooterTest.php.

80  {
81  $this->assertEquals(
82  $this->text,
83  $footer->getText()
84  );
85  }

◆ testPermanentURL()

FooterTest::testPermanentURL (   $footer)

testConstruction

Definition at line 90 of file FooterTest.php.

91  {
92  $df = new \ILIAS\Data\Factory();
93  $footer = $footer->withPermanentURL($df->uri($this->perm_url));
94  $perm_url = $footer->getPermanentURL();
95  $this->assertInstanceOf("\\ILIAS\\Data\\URI", $perm_url);
96  $this->assertEquals(
97  $perm_url->getBaseURI() . '?' . $perm_url->getQuery(),
98  $this->perm_url
99  );
100  return $footer;
101  }

◆ testRendering()

FooterTest::testRendering (   $footer)

testConstruction

Definition at line 117 of file FooterTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), footer(), ILIAS_UI_TestBase\getDefaultRenderer(), and up().

118  {
119  $r = $this->getDefaultRenderer();
120  $html = $r->render($footer);
121 
122  $expected = <<<EOT
123  <div class="il-maincontrols-footer">
124  <div class="il-footer-content">
125  <div class="il-footer-text">
126  footer text
127  </div>
128 
129  <div class="il-footer-links">
130  <ul>
131  <li><a href="http://www.ilias.de" >Goto ILIAS</a></li>
132  <li><a href="#" >go up</a></li>
133  </ul>
134  </div>
135  </div>
136  </div>
137 EOT;
138 
139  $this->assertEquals(
140  $this->brutallyTrimHTML($expected),
141  $this->brutallyTrimHTML($html)
142  );
143  }
Class ChatMainBarProvider .
up()
Definition: up.php:2
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:268
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:346
+ Here is the call graph for this function:

◆ testRenderingNoLinks()

FooterTest::testRenderingNoLinks (   $footer)

testConstructionNoLinks

Definition at line 148 of file FooterTest.php.

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

149  {
150  $r = $this->getDefaultRenderer();
151  $html = $r->render($footer);
152 
153  $expected = <<<EOT
154  <div class="il-maincontrols-footer">
155  <div class="il-footer-content">
156  <div class="il-footer-text">
157  footer text
158  </div>
159  </div>
160  </div>
161 EOT;
162 
163  $this->assertEquals(
164  $this->brutallyTrimHTML($expected),
165  $this->brutallyTrimHTML($html)
166  );
167  }
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:268
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:346
+ Here is the call graph for this function:

◆ testRenderingPermUrl()

FooterTest::testRenderingPermUrl (   $footer)

testPermanentURL

Definition at line 172 of file FooterTest.php.

References ILIAS_UI_TestBase\brutallyTrimHTML(), footer(), ILIAS_UI_TestBase\getDefaultRenderer(), and up().

173  {
174  $r = $this->getDefaultRenderer();
175  $html = $r->render($footer);
176 
177  $expected = <<<EOT
178  <div class="il-maincontrols-footer">
179  <div class="il-footer-content">
180  <div class="il-footer-permanent-url"><label for="current_perma_link">perma_link</label><input id="current_perma_link" type="text" value="http://www.ilias.de/goto.php?target=xxx_123" readonly="readOnly">
181  </div>
182 
183  <div class="il-footer-text">footer text</div>
184 
185  <div class="il-footer-links">
186  <ul>
187  <li><a href="http://www.ilias.de" >Goto ILIAS</a></li>
188  <li><a href="#" >go up</a></li>
189  </ul>
190  </div>
191  </div>
192  </div>
193 EOT;
194 
195  $this->assertEquals(
196  $this->brutallyTrimHTML($expected),
197  $this->brutallyTrimHTML($html)
198  );
199  }
Class ChatMainBarProvider .
up()
Definition: up.php:2
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:268
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
Definition: Base.php:346
+ Here is the call graph for this function:

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