renderHeaderException example

static::expectException(RenderFooterException::class);

        throw $exception;
    }

    /** * @DisabledFeatures(features={"v6.6.0.0"}) */
    public function testRenderHeaderException(): void
    {
        $exception = ProductExportException::renderHeaderException('Header!');
        static::assertSame('Failed rendering string template using Twig: Header!', $exception->getMessage());

        static::expectException(RenderHeaderException::class);

        throw $exception;
    }

    /** * @DisabledFeatures(features={"v6.6.0.0"}) */
    public function testRenderProductException(): void
    {


        try {
            $content = $this->templateRenderer->render(
                $productExport->getHeaderTemplate(),
                $headerContext->getContext(),
                $salesChannelContext->getContext()
            ) . \PHP_EOL;

            return $this->replaceSeoUrlPlaceholder($content$productExport$salesChannelContext);
        } catch (StringTemplateRenderingException $exception) {
            $renderHeaderException = ProductExportException::renderHeaderException($exception->getMessage());
            $this->logException($salesChannelContext->getContext()$renderHeaderException);

            throw $renderHeaderException;
        }
    }

    public function renderFooter(
        ProductExportEntity $productExport,
        SalesChannelContext $salesChannelContext
    ): string {
        if ($productExport->getFooterTemplate() === null) {
            
Home | Imprint | This part of the site doesn't use cookies.