10 $underlying = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\Loader::class)
11 ->setMethods([
"getRendererFor",
"getRendererFactoryFor"])
14 $renderer = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ComponentRenderer::class)
15 ->setMethods([
"registerResources",
"render"])
17 $component = $this->getMockBuilder(\
ILIAS\
UI\
Component\Component::class)->getMock();
20 ->expects($this->
once())
21 ->method(
"getRendererFor")
23 ->willReturn($renderer);
25 $registry = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ResourceRegistry::class)
28 $l = new \ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper($registry, $underlying);
31 $this->assertSame($renderer,
$r);
36 $underlying = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\Loader::class)
37 ->setMethods([
"getRendererFor",
"getRendererFactoryFor"])
40 $renderer = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ComponentRenderer::class)
41 ->setMethods([
"registerResources",
"render"])
43 $component = $this->getMockBuilder(\
ILIAS\
UI\
Component\Component::class)->getMock();
45 ->expects($this->
once())
46 ->method(
"getRendererFor")
47 ->with($component, [])
48 ->willReturn($renderer);
50 $registry = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ResourceRegistry::class)
54 ->expects($this->
once())
55 ->method(
"registerResources")
58 $l = new \ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper($registry, $underlying);
59 $r =
$l->getRendererFor($component, []);
64 $underlying = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\Loader::class)
65 ->setMethods([
"getRendererFor",
"getRendererFactoryFor"])
72 ->expects($this->exactly(1))
73 ->method(
"getRendererFactoryFor")
77 $l = new \ILIAS\UI\Implementation\Render\LoaderCachingWrapper($underlying);
79 $this->assertSame(
$factory,
$l->getRendererFactoryFor($c1));
test_passthrough_getRendererFactory()
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
test_forwards_from_underlying()