renderProductException example

static::expectException(RenderHeaderException::class);

        throw $exception;
    }

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

        static::expectException(RenderProductException::class);

        throw $exception;
    }

    public function testRenderFooterException660(): void
    {
        $exception = ProductExportException::renderFooterException('Footer!');
        static::assertSame('Failed rendering string template using Twig: Footer!', $exception->getMessage());

        


        try {
            $content = $this->templateRenderer->render(
                $bodyTemplate,
                $data,
                $salesChannelContext->getContext()
            ) . \PHP_EOL;

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

            throw $renderProductException;
        }
    }

    private function logException(
        Context $context,
        \Exception $exception
    ): void {
        $loggingEvent = new ProductExportLoggingEvent(
            
Home | Imprint | This part of the site doesn't use cookies.