diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php index 96587a24c..4a6fc032f 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php @@ -25,6 +25,7 @@ use libphonenumber\PhoneNumberUtil; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; +use Symfony\Component\Clock\MockClock; use Symfony\Component\Serializer\Exception\ExceptionInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; @@ -122,7 +123,9 @@ final class UserNormalizerTest extends TestCase $userRender = $this->prophesize(UserRender::class); $userRender->renderString(Argument::type(User::class), Argument::type('array'))->willReturn($user ? $user->getLabel() : ''); - $normalizer = new UserNormalizer($userRender->reveal()); + $clock = new MockClock(new \DateTimeImmutable('now')); + + $normalizer = new UserNormalizer($userRender->reveal(), $clock); $normalizer->setNormalizer(new class () implements NormalizerInterface { public function normalize($object, ?string $format = null, array $context = []) {