From 26a4b57cfb772f59995fbf749c6f9acc131ae6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 6 Jan 2024 15:01:50 +0100 Subject: [PATCH] Fixed tests related to PartNormalizer --- tests/Serializer/PartNormalizerTest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/Serializer/PartNormalizerTest.php b/tests/Serializer/PartNormalizerTest.php index 979254d8..39295a86 100644 --- a/tests/Serializer/PartNormalizerTest.php +++ b/tests/Serializer/PartNormalizerTest.php @@ -45,7 +45,9 @@ class PartNormalizerTest extends WebTestCase { //Normalizer must only support Part objects (and child classes) $this->assertFalse($this->service->supportsNormalization(new \stdClass())); - $this->assertTrue($this->service->supportsNormalization(new Part())); + //Part serialization should only work with csv + $this->assertFalse($this->service->supportsNormalization(new Part())); + $this->assertTrue($this->service->supportsNormalization(new Part(), 'csv')); } public function testNormalize(): void @@ -59,11 +61,6 @@ class PartNormalizerTest extends WebTestCase $part->addPartLot($partLot1); $part->addPartLot($partLot2); - $data = $this->service->normalize($part, 'json', ['groups' => ['simple']]); - $this->assertSame('Test Part', $data['name']); - $this->assertSame(6.0, $data['total_instock']); - $this->assertSame('part', $data['type']); - //Check that type field is not present in CSV export $data = $this->service->normalize($part, 'csv', ['groups' => ['simple']]); $this->assertSame('Test Part', $data['name']);