ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Protected Attributes

TemplateFactoryMock $tpl_factory
 
NoUIFactory $ui_factory
 
ilLanguageMock $lng
 
LoggingJavaScriptBinding $js_binding
 
 $image_path_resolver
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

Definition at line 180 of file AbstractRendererTest.php.

Member Function Documentation

◆ setUp()

AbstractRendererTest::setUp ( )

Definition at line 191 of file AbstractRendererTest.php.

References ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getUIFactory(), and ILIAS\Repository\lng().

191  : void
192  {
193  parent::setUp();
194  $this->tpl_factory = new TemplateFactoryMock();
195  $this->ui_factory = $this->getUIFactory(); //new NoUIFactory();
196  $this->lng = new ilLanguageMock();
197  $this->js_binding = new LoggingJavaScriptBinding();
198  $this->image_path_resolver = $this->getMockBuilder(ILIAS\UI\Implementation\Render\ImagePathResolver::class)
199  ->getMock();
200  }
Class Factory.
Class ChatMainBarProvider .
+ Here is the call graph for this function:

◆ test_bindJavaScript_no_string()

AbstractRendererTest::test_bindJavaScript_no_string ( )

Definition at line 269 of file AbstractRendererTest.php.

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

269  : void
270  {
272  $this->ui_factory,
273  $this->tpl_factory,
274  $this->lng,
275  $this->js_binding,
276  $this->getRefinery(),
277  $this->image_path_resolver,
278  $this->getDataFactory()
279  );
280 
281  $g = new Glyph(C\Symbol\Glyph\Glyph::SETTINGS, "aria_label");
282 
283  $g = $g->withOnLoadCode(function ($id) {
284  return null;
285  });
286 
287  try {
288  $r->render($g, new NullDefaultRenderer());
289  $this->assertFalse("This should not happen...");
290  } catch (LogicException $e) {
291  $this->assertTrue(true);
292  }
293  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ test_bindJavaScript_successfull()

AbstractRendererTest::test_bindJavaScript_successfull ( )

Definition at line 243 of file AbstractRendererTest.php.

References $id, ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getDataFactory(), ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getRefinery(), and ILIAS\Repository\lng().

243  : void
244  {
246  $this->ui_factory,
247  $this->tpl_factory,
248  $this->lng,
249  $this->js_binding,
250  $this->getRefinery(),
251  $this->image_path_resolver,
252  $this->getDataFactory()
253  );
254 
255  $g = new Glyph(C\Symbol\Glyph\Glyph::SETTINGS, "aria_label");
256 
257  $ids = array();
258  $g = $g->withOnLoadCode(function ($id) use (&$ids) {
259  $ids[] = $id;
260  return "ID: $id";
261  });
262  $r->render($g, new NullDefaultRenderer());
263 
264  $this->assertEquals($this->js_binding->ids, $ids);
265  $this->assertEquals(array("id_1"), $ids);
266  $this->assertEquals(array("ID: id_1"), $this->js_binding->on_load_code);
267  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ test_getTemplate_successfull()

AbstractRendererTest::test_getTemplate_successfull ( )

Definition at line 202 of file AbstractRendererTest.php.

References ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getDataFactory(), ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getRefinery(), and ILIAS\Repository\lng().

202  : void
203  {
204  $r = new GlyphNonAbstractRenderer(
205  $this->ui_factory,
206  $this->tpl_factory,
207  $this->lng,
208  $this->js_binding,
209  $this->getRefinery(),
210  $this->image_path_resolver,
211  $this->getDataFactory()
212  );
213  $r->_getTemplate("tpl.glyph.html", true, false);
214 
215  $expected = array(realpath(__DIR__ . "/../../../src/UI/templates/default/Symbol/tpl.glyph.html")
216  => array(true, false)
217  );
218 
219  $this->assertEquals($expected, $this->tpl_factory->files);
220  }
+ Here is the call graph for this function:

◆ test_getTemplate_unsuccessfull()

AbstractRendererTest::test_getTemplate_unsuccessfull ( )

Definition at line 222 of file AbstractRendererTest.php.

References ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getDataFactory(), ILIAS\UI\Implementation\Render\AbstractComponentRenderer\getRefinery(), and ILIAS\Repository\lng().

222  : void
223  {
225  $this->ui_factory,
226  $this->tpl_factory,
227  $this->lng,
228  $this->js_binding,
229  $this->getRefinery(),
230  $this->image_path_resolver,
231  $this->getDataFactory()
232  );
233 
234  $this->expectException(TypeError::class);
235  $r->_getTemplate("tpl.counter_foo.html", true, false);
236 
237  $expected = array(realpath(__DIR__ . "/../../src/UI/templates/default/Counter/tpl.counter_foo.html")
238  => array(true, false)
239  );
240  $this->assertEquals($expected, $this->tpl_factory->files);
241  }
+ Here is the call graph for this function:

Field Documentation

◆ $image_path_resolver

AbstractRendererTest::$image_path_resolver
protected

Definition at line 189 of file AbstractRendererTest.php.

◆ $js_binding

LoggingJavaScriptBinding AbstractRendererTest::$js_binding
protected

Definition at line 185 of file AbstractRendererTest.php.

◆ $lng

ilLanguageMock AbstractRendererTest::$lng
protected

Definition at line 184 of file AbstractRendererTest.php.

◆ $tpl_factory

TemplateFactoryMock AbstractRendererTest::$tpl_factory
protected

Definition at line 182 of file AbstractRendererTest.php.

◆ $ui_factory

NoUIFactory AbstractRendererTest::$ui_factory
protected

Definition at line 183 of file AbstractRendererTest.php.


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