diff --git a/tests/integration/Core/Checkout/Document/Renderer/InvoiceRendererTest.php b/tests/integration/Core/Checkout/Document/Renderer/InvoiceRendererTest.php index 6f52a81a207..f70a25644b2 100644 --- a/tests/integration/Core/Checkout/Document/Renderer/InvoiceRendererTest.php +++ b/tests/integration/Core/Checkout/Document/Renderer/InvoiceRendererTest.php @@ -161,7 +161,7 @@ function (DocumentGenerateOperation $operation, ContainerInterface $container) u ], ]); }, - function (RenderedDocument $rendered, OrderEntity $order, ContainerInterface $container): void { + function (RenderedDocument $rendered, OrderEntity $order, ContainerInterface $container) use ($documentDate): void { static::assertNotNull($order->getCurrency()); static::assertStringContainsString( @@ -177,7 +177,7 @@ function (RenderedDocument $rendered, OrderEntity $order, ContainerInterface $co static::assertNotNull($order->getLanguage()); static::assertNotNull($locale = $order->getLanguage()->getLocale()); $formatter = new \IntlDateFormatter($locale->getCode(), \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE); - $formattedDate = $formatter->format(new \DateTime()); + $formattedDate = $formatter->format($documentDate); static::assertNotFalse($formattedDate); static::assertStringContainsString( @@ -222,7 +222,7 @@ function (DocumentGenerateOperation $operation, ContainerInterface $container) u ], ]); }, - function (RenderedDocument $rendered, OrderEntity $order, ContainerInterface $container): void { + function (RenderedDocument $rendered, OrderEntity $order, ContainerInterface $container) use ($documentDate): void { static::assertNotNull($order->getCurrency()); static::assertStringContainsString( @@ -239,7 +239,7 @@ function (RenderedDocument $rendered, OrderEntity $order, ContainerInterface $co static::assertNotNull($order->getLanguage()); static::assertNotNull($locale = $order->getLanguage()->getLocale()); $formatter = new \IntlDateFormatter($locale->getCode(), \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE); - $formattedDate = $formatter->format(new \DateTime()); + $formattedDate = $formatter->format($documentDate); static::assertNotFalse($formattedDate); static::assertStringContainsString(