ILIAS  release_7 Revision v7.30-3-g800a261c036
AbstractRendererTest Class Reference
+ Inheritance diagram for AbstractRendererTest:
+ Collaboration diagram for AbstractRendererTest:

Public Member Functions

 setUp ()
 
 test_getTemplate_successfull ()
 
 test_getTemplate_unsuccessfull ()
 
 test_bindJavaScript_successfull ()
 
 test_bindJavaScript_no_string ()
 
- 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)
 

Additional Inherited Members

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

Detailed Description

Definition at line 125 of file AbstractRendererTest.php.

Member Function Documentation

◆ setUp()

AbstractRendererTest::setUp ( )

Definition at line 127 of file AbstractRendererTest.php.

References ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getUIFactory().

127  : void
128  {
129  parent::setUp();
130  $this->tpl_factory = new TemplateFactoryMock();
131  $this->ui_factory = $this->getUIFactory(); //new NoUIFactory();
132  $this->lng = new ilLanguageMock();
133  $this->js_binding = new LoggingJavaScriptBinding();
134  $this->image_path_resolver = $this->getMockBuilder(ILIAS\UI\Implementation\Render\ImagePathResolver::class)
135  ->getMock();
136  }
Class Factory.
Class ChatMainBarProvider .
+ Here is the call graph for this function:

◆ test_bindJavaScript_no_string()

AbstractRendererTest::test_bindJavaScript_no_string ( )

Definition at line 205 of file AbstractRendererTest.php.

References Vendor\Package\$e, and ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getRefinery().

206  {
207  $r = new \ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphNonAbstractRendererWithJS(
208  $this->ui_factory,
209  $this->tpl_factory,
210  $this->lng,
211  $this->js_binding,
212  $this->getRefinery(),
213  $this->image_path_resolver
214  );
215 
216  $g = new \ILIAS\UI\Implementation\Component\Symbol\Glyph\Glyph(\ILIAS\UI\Component\Symbol\Glyph\Glyph::SETTINGS, "aria_label");
217 
218  $g = $g->withOnLoadCode(function ($id) {
219  return null;
220  });
221 
222  try {
223  $r->render($g, new NullDefaultRenderer());
224  $this->assertFalse("This should not happen...");
225  } catch (\LogicException $e) {
226  $this->assertTrue(true);
227  }
228  }
Class Factory.
Class ChatMainBarProvider .
+ Here is the call graph for this function:

◆ test_bindJavaScript_successfull()

AbstractRendererTest::test_bindJavaScript_successfull ( )

Definition at line 180 of file AbstractRendererTest.php.

References ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getRefinery().

181  {
182  $r = new \ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphNonAbstractRendererWithJS(
183  $this->ui_factory,
184  $this->tpl_factory,
185  $this->lng,
186  $this->js_binding,
187  $this->getRefinery(),
188  $this->image_path_resolver
189  );
190 
191  $g = new \ILIAS\UI\Implementation\Component\Symbol\Glyph\Glyph(\ILIAS\UI\Component\Symbol\Glyph\Glyph::SETTINGS, "aria_label");
192 
193  $ids = array();
194  $g = $g->withOnLoadCode(function ($id) use (&$ids) {
195  $ids[] = $id;
196  return "ID: $id";
197  });
198  $r->render($g, new NullDefaultRenderer());
199 
200  $this->assertEquals($this->js_binding->ids, $ids);
201  $this->assertEquals(array("id_1"), $ids);
202  $this->assertEquals(array("ID: id_1"), $this->js_binding->on_load_code);
203  }
Class Factory.
Class ChatMainBarProvider .
+ Here is the call graph for this function:

◆ test_getTemplate_successfull()

AbstractRendererTest::test_getTemplate_successfull ( )

Definition at line 138 of file AbstractRendererTest.php.

References $tpl, and ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getRefinery().

139  {
140  $r = new \ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphNonAbstractRenderer(
141  $this->ui_factory,
142  $this->tpl_factory,
143  $this->lng,
144  $this->js_binding,
145  $this->getRefinery(),
146  $this->image_path_resolver
147  );
148  $tpl = $r->_getTemplate("tpl.glyph.html", true, false);
149 
150  $expected = array( realpath(__DIR__ . "/../../../src/UI/templates/default/Symbol/tpl.glyph.html")
151  => array(true, false)
152  );
153 
154  $this->assertEquals($expected, $this->tpl_factory->files);
155  }
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

◆ test_getTemplate_unsuccessfull()

AbstractRendererTest::test_getTemplate_unsuccessfull ( )

Definition at line 157 of file AbstractRendererTest.php.

References Vendor\Package\$e, $tpl, and ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getRefinery().

158  {
159  $r = new \ILIAS\UI\Implementation\Component\Counter\CounterNonAbstractRenderer(
160  $this->ui_factory,
161  $this->tpl_factory,
162  $this->lng,
163  $this->js_binding,
164  $this->getRefinery(),
165  $this->image_path_resolver
166  );
167 
168  try {
169  $tpl = $r->_getTemplate("tpl.counter_foo.html", true, false);
170  $this->assertFalse("We should not get here");
171  } catch (\InvalidArgumentException $e) {
172  };
173 
174  $expected = array( realpath(__DIR__ . "/../../src/UI/templates/default/Counter/tpl.counter_foo.html")
175  => array(true, false)
176  );
177  $this->assertEquals($expected, $this->tpl_factory->files);
178  }
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

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