5use PHPUnit\Framework\TestCase;
 
   11        $underlying = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\Loader::class)
 
   12            ->setMethods([
"getRendererFor", 
"getRendererFactoryFor"])
 
   15        $renderer = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ComponentRenderer::class)
 
   16            ->setMethods([
"registerResources", 
"render"])
 
   18        $component = $this->getMockBuilder(\
ILIAS\
UI\Component\Component::class)->getMock();
 
   21            ->expects($this->once())
 
   22            ->method(
"getRendererFor")
 
   24            ->willReturn($renderer);
 
   26        $registry = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ResourceRegistry::class)
 
   29        $l = new \ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper($registry, $underlying);
 
   30        $r = $l->getRendererFor($component, 
$context);
 
   32        $this->assertSame($renderer, $r);
 
   37        $underlying = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\Loader::class)
 
   38            ->setMethods([
"getRendererFor", 
"getRendererFactoryFor"])
 
   41        $renderer = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ComponentRenderer::class)
 
   42            ->setMethods([
"registerResources", 
"render"])
 
   44        $component = $this->getMockBuilder(\
ILIAS\
UI\Component\Component::class)->getMock();
 
   46            ->expects($this->once())
 
   47            ->method(
"getRendererFor")
 
   48            ->with($component, [])
 
   49            ->willReturn($renderer);
 
   51        $registry = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\ResourceRegistry::class)
 
   55            ->expects($this->once())
 
   56            ->method(
"registerResources")
 
   59        $l = new \ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper($registry, $underlying);
 
   60        $r = $l->getRendererFor($component, []);
 
   65        $underlying = $this->getMockBuilder(\
ILIAS\
UI\Implementation\Render\Loader::class)
 
   66            ->setMethods([
"getRendererFor", 
"getRendererFactoryFor"])
 
   69        $c1 = $this->createMock(\
ILIAS\
UI\Component\Component::class);
 
   73            ->expects($this->exactly(1))
 
   74            ->method(
"getRendererFactoryFor")
 
   78        $l = new \ILIAS\UI\Implementation\Render\LoaderCachingWrapper($underlying);
 
   80        $this->assertSame(
$factory, $l->getRendererFactoryFor($c1));
 
An exception for terminatinating execution or to throw for unit testing.
test_forwards_from_underlying()
test_passthrough_getRendererFactory()
Class ChatMainBarProvider \MainMenu\Provider.