renderFooterException example



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

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

            throw $renderFooterException;
        }
    }

    /** * @param array<string, mixed> $data */
    public function renderBody(
        ProductExportEntity $productExport,
        
static::expectException(ProductExportException::class);

        throw $exception;
    }

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

        static::expectException(RenderFooterException::class);

        throw $exception;
    }

    /** * @DisabledFeatures(features={"v6.6.0.0"}) */
    public function testRenderHeaderException(): void
    {
Home | Imprint | This part of the site doesn't use cookies.