◆ getComponentRendererFSLoader()
ComponentRendererFSLoaderTest::getComponentRendererFSLoader |
( |
| ) |
|
|
protected |
Definition at line 20 of file ComponentRendererFSLoaderTest.php.
References ILIAS\UI\Implementation\Render\FSLoader\$default_renderer_factory, and $lng.
22 $ui_factory = $this->getMockBuilder(
ILIAS\
UI\Factory::class)->getMock();
23 $tpl_factory = $this->getMockBuilder(
I\Render\TemplateFactory::class)->getMock();
24 $lng = $this->getMockBuilder(\ilLanguage::class)->disableOriginalConstructor()->getMock();
25 $js_binding = $this->getMockBuilder(
I\Render\JavaScriptBinding::class)->getMock();
26 $refinery_mock = $this->getMockBuilder(\
ILIAS\
Refinery\Factory::class)
27 ->disableOriginalConstructor()
29 $image_path_resolver = $this->getMockBuilder(
ILIAS\
UI\Implementation\Render\ImagePathResolver::class)
32 $default_renderer_factory =
new I\Render\DefaultRendererFactory(
40 $this->glyph_renderer = $this->createMock(
I\Render\RendererFactory::class);
41 $this->field_renderer = $this->createMock(
I\Render\RendererFactory::class);
Class ChatMainBarProvider .
◆ test_getRenderer_successfully()
ComponentRendererFSLoaderTest::test_getRenderer_successfully |
( |
| ) |
|
Definition at line 45 of file ComponentRendererFSLoaderTest.php.
References Vendor\Package\$f.
49 $component =
new I\Component\Button\Standard(
"",
"");
50 $r =
$f->getRendererFor($component, []);
51 $this->assertInstanceOf(
I\Render\ComponentRenderer::class, $r);
getComponentRendererFSLoader()
◆ test_getRenderer_successfully_extra()
ComponentRendererFSLoaderTest::test_getRenderer_successfully_extra |
( |
| ) |
|
Definition at line 54 of file ComponentRendererFSLoaderTest.php.
References $context, and Vendor\Package\$f.
58 $component =
new I\Component\Symbol\Glyph\Glyph(
"up",
"up");
60 $renderer = $this->createMock(
I\Render\ComponentRenderer::class);
62 $context_name =
"foo";
64 ->expects($this->once())
65 ->method(
"getCanonicalName")
66 ->willReturn($context_name);
69 ->expects($this->once())
70 ->method(
"getRendererInContext")
71 ->with($component, [$context_name])
72 ->willReturn($renderer);
74 $r =
$f->getRendererFor($component, [
$context]);
76 $this->assertEquals($renderer, $r);
Class ChatMainBarProvider .
getComponentRendererFSLoader()
◆ test_getRenderer_uses_RendererFactory()
ComponentRendererFSLoaderTest::test_getRenderer_uses_RendererFactory |
( |
| ) |
|
Definition at line 79 of file ComponentRendererFSLoaderTest.php.
References $factory.
81 $loader = $this->getMockBuilder(
ILIAS\
UI\Implementation\Render\FSLoader::class)
82 ->setMethods([
"getRendererFactoryFor",
"getContextNames"])
83 ->disableOriginalConstructor()
85 $factory = $this->getMockBuilder(
ILIAS\
UI\Implementation\RendererFactory::class)
86 ->setMethods([
"getRendererInContext"])
89 $rendered_component = $this->createMock(
ILIAS\
UI\
Component\Component::class);
93 $component_name1 =
"COMPONENT 1";
94 $component_name2 =
"COMPONENT 2";
97 ->expects($this->once())
98 ->method(
"getContextNames")
99 ->with([$component1, $component2])
100 ->willReturn([$component_name1, $component_name2]);
103 ->expects($this->once())
104 ->method(
"getRendererFactoryFor")
105 ->with($rendered_component)
108 $renderer =
"RENDERER";
110 ->expects($this->once())
111 ->method(
"getRendererInContext")
112 ->with($rendered_component, [$component_name1, $component_name2])
113 ->willReturn($renderer);
115 $renderer2 = $loader->getRendererFor($rendered_component, [$component1, $component2]);
116 $this->assertEquals($renderer, $renderer2);
Class ChatMainBarProvider .
The documentation for this class was generated from the following file: