Skip to content

Commit 9e989b6

Browse files
committed
Move test
1 parent 703536c commit 9e989b6

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

src/Symfony/Component/Serializer/Tests/Normalizer/AbstractObjectNormalizerTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@
4242
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
4343
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
4444
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
45+
use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
4546
use Symfony\Component\Serializer\Serializer;
4647
use Symfony\Component\Serializer\SerializerAwareInterface;
4748
use Symfony\Component\Serializer\SerializerInterface;
4849
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\AbstractDummy;
4950
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\AbstractDummyFirstChild;
5051
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\AbstractDummySecondChild;
5152
use Symfony\Component\Serializer\Tests\Fixtures\DummyFirstChildQuux;
53+
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface;
54+
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberFour;
5255
use Symfony\Component\Serializer\Tests\Fixtures\DummySecondChildQuux;
5356
use Symfony\Component\Serializer\Tests\Fixtures\DummyString;
5457
use Symfony\Component\Serializer\Tests\Fixtures\DummyWithNotNormalizable;
@@ -1087,6 +1090,25 @@ public static function provideBooleanTypesData()
10871090
[['foo' => false], TruePropertyDummy::class],
10881091
];
10891092
}
1093+
1094+
public function testDeserializeAndSerializeConstructorAndIgnoreAndInterfacedObjectsWithTheClassMetadataDiscriminator()
1095+
{
1096+
$example = new DummyMessageNumberFour('Hello');
1097+
1098+
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
1099+
1100+
$normalizer = new PropertyNormalizer(
1101+
$classMetadataFactory,
1102+
null,
1103+
new PropertyInfoExtractor([], [new PhpDocExtractor(), new ReflectionExtractor()]),
1104+
new ClassDiscriminatorFromClassMetadata($classMetadataFactory),
1105+
);
1106+
1107+
$serialized = $normalizer->normalize($example, 'json');
1108+
$deserialized = $normalizer->denormalize($serialized, DummyMessageInterface::class, 'json');
1109+
1110+
$this->assertEquals($example, $deserialized);
1111+
}
10901112
}
10911113

10921114
class AbstractObjectNormalizerDummy extends AbstractObjectNormalizer

src/Symfony/Component/Serializer/Tests/Normalizer/PropertyNormalizerTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\GroupDummy;
3232
use Symfony\Component\Serializer\Tests\Fixtures\Attributes\GroupDummyChild;
3333
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
34-
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageInterface;
35-
use Symfony\Component\Serializer\Tests\Fixtures\DummyMessageNumberFour;
3634
use Symfony\Component\Serializer\Tests\Fixtures\Php74Dummy;
3735
use Symfony\Component\Serializer\Tests\Fixtures\PropertyCircularReferenceDummy;
3836
use Symfony\Component\Serializer\Tests\Fixtures\PropertySiblingHolder;
@@ -518,25 +516,6 @@ public function testDenormalizeWithDiscriminator()
518516

519517
$this->assertEquals($denormalized, $normalizer->denormalize(['type' => 'two', 'url' => 'url'], PropertyDummyInterface::class));
520518
}
521-
522-
public function testDeserializeAndSerializeConstructorAndIgnoreAndInterfacedObjectsWithTheClassMetadataDiscriminator()
523-
{
524-
$example = new DummyMessageNumberFour('Hello');
525-
526-
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
527-
528-
$normalizer = new PropertyNormalizer(
529-
$classMetadataFactory,
530-
null,
531-
new PropertyInfoExtractor([], [new PhpDocExtractor(), new ReflectionExtractor()]),
532-
new ClassDiscriminatorFromClassMetadata($classMetadataFactory),
533-
);
534-
535-
$serialized = $normalizer->normalize($example, 'json');
536-
$deserialized = $normalizer->denormalize($serialized, DummyMessageInterface::class, 'json');
537-
538-
$this->assertEquals($example, $deserialized);
539-
}
540519
}
541520

542521
class PropertyDummy

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy