Skip to content

Commit

Permalink
Merge branch 'NEXT-37994/fix-flaky-test' into 'trunk'
Browse files Browse the repository at this point in the history
NEXT-37994 - fix flaky InvoiceRendererTest

Closes NEXT-37994

See merge request shopware/6/product/platform!14575
  • Loading branch information
keulinho committed Aug 22, 2024
2 parents 6454209 + 2abbe46 commit 7365851
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 7365851

Please sign in to comment.