6 require_once(
"libs/composer/vendor/autoload.php");
9 use \ILIAS\UI\Implementation\Render\ResourceRegistry;
11 use \ILIAS\UI\Component\Component;
21 return $component->text;
33 require_once(
"libs/composer/vendor/autoload.php");
34 require_once(__DIR__.
"/../Base.php");
36 use \ILIAS\UI\Component as
C;
37 use \ILIAS\UI\Implementation\Glyph\Renderer as GlyphRenderer;
42 $dr = $this->getDefaultRenderer();
43 $r = $dr->instantiateRendererFor(
"\\ILIAS\\UI\\Implementation\\Component\\Glyph\\Glyph");
44 $this->assertInstanceOf(
"\\ILIAS\\UI\\Implementation\\Render\\ComponentRenderer",
$r);
49 $dr = $this->getDefaultRenderer();
50 $r = $dr->getRendererFor(
"\\ILIAS\\UI\\Implementation\\Component\\Glyph\\Glyph");
51 $this->assertInstanceOf(
"\\ILIAS\\UI\\Implementation\\Render\\ComponentRenderer",
$r);
55 $dr = $this->getDefaultRenderer();
56 $r1 = $dr->getRendererFor(
"\\ILIAS\\UI\\Implementation\\Component\\Glyph\\Glyph");
57 $r2 = $dr->getRendererFor(
"\\ILIAS\\UI\\Implementation\\Component\\Glyph\\Glyph");
58 $this->assertTrue($r1 === $r2,
"Instances not equal");
62 $dr = $this->getDefaultRenderer();
64 $renderer_class = $dr->getRendererNameFor(
"\\ILIAS\\UI\\Implementation\\Component\\Glyph\\Glyph");
65 $expected =
"\\ILIAS\\UI\\Implementation\\Component\\Glyph\\Renderer";
66 $this->assertEquals($expected, $renderer_class);
70 $this->resource_registry = parent::getResourceRegistry();
71 return $this->resource_registry;
75 $dr = $this->getDefaultRenderer();
76 $component = new \ILIAS\UI\Test\TestComponent(
"foo");
78 $dr->render($component);
80 $this->assertEquals(
array(
"test.js"), $this->resource_registry->resources);
Registry for resources required by rendered output like Javascript or CSS.
An entity that renders components to a string output.
A component is the most general form of an entity in the UI.
test_getRendererNameFor()
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.
Provides common functionality for UI tests.
test_getRenderer_caching()
test_instantiateRenderer_successfully()
test_getRenderer_successfully()
Create styles array
The data for the language used.
register($name)
Add a dependency.
render(Component $component, DefaultRenderer $default_renderer)