From 93b51a76cc9eb721f5c3b70d7dbfcda2efaf3be8 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Tue, 3 Dec 2024 19:23:28 +0530 Subject: [PATCH] Declared mock Entity in testDenormalizer --- tests/Serializer/EntitySerializerTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Serializer/EntitySerializerTest.php b/tests/Serializer/EntitySerializerTest.php index fad93329..e9b4ea75 100644 --- a/tests/Serializer/EntitySerializerTest.php +++ b/tests/Serializer/EntitySerializerTest.php @@ -120,7 +120,8 @@ public function testDenormalize(mixed $normalized): void // Set value of this nullable value to ensure that a special condition is triggered in the EntityDenormalizer. $normalized->nullable = null; /** @var MockEntity $object */ - $object = static::$serializer->denormalize($normalized, MockEntity::class); + $mockEntity = new MockEntity(); + $object = static::$serializer->denormalize($normalized, $mockEntity::class); $this->assertTrue(true === $object->isBool()); $this->assertTrue(2 === $object->getInt()); $this->assertTrue(0 === $object->getZero());