onDocumentRendering example

$request = Request::createFromGlobals();
        $event = new DocumentTemplateRendererParameterEvent($parameters);
        $themeLoader = $this->createMock(SalesChannelThemeLoader::class);

        $themeLoader->method('load')->willReturn([
            'themeName' => $usingTheme,
            'parentThemeName' => null,
        ]);

        $builder = new ThemeNamespaceHierarchyBuilder(new TestInheritanceBuilder()$themeLoader);

        $builder->onDocumentRendering($event);

        $this->assertThemes($expectedThemes$builder);

        $builder = new ThemeNamespaceHierarchyBuilder(new TestInheritanceBuilder()$themeLoader);

        $builder->requestEvent(new ExceptionEvent($this->createMock(HttpKernelInterface::class)$request, HttpKernelInterface::MAIN_REQUEST, new \RuntimeException()));

        $this->assertThemes([]$builder);
    }

    public function testRequestEventWithExceptionEvent(): void
    {
Home | Imprint | This part of the site doesn't use cookies.