Skip to content

Commit cbae546

Browse files
committed
[Serializer] Refactor tests to not extends ObjectNormalize
1 parent 0ed4969 commit cbae546

File tree

5 files changed

+4
-41
lines changed

5 files changed

+4
-41
lines changed

src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ public function supportsNormalization(mixed $data, string $format = null /* , ar
6666
*
6767
* @return array<class-string|'*'|'object'|string, bool|null>
6868
*/
69-
/* public function getSupportedTypes(?string $format): array; */
69+
public function getSupportedTypes(?string $format): array;
7070
}

src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ private function createXmlEncoderWithDateTimeNormalizer(): XmlEncoder
934934

935935
private function createMockDateTimeNormalizer(): MockObject&NormalizerInterface
936936
{
937-
$mock = $this->createMock(CustomNormalizer::class);
937+
$mock = $this->createMock(NormalizerInterface::class);
938938

939939
$mock
940940
->expects($this->once())

src/Symfony/Component/Serializer/Tests/Fixtures/FormatAndContextAwareNormalizer.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummy;
3838
use Symfony\Component\Serializer\Tests\Fixtures\CircularReferenceDummy;
3939
use Symfony\Component\Serializer\Tests\Fixtures\DummyPrivatePropertyWithoutGetter;
40-
use Symfony\Component\Serializer\Tests\Fixtures\FormatAndContextAwareNormalizer;
4140
use Symfony\Component\Serializer\Tests\Fixtures\OtherSerializedNameDummy;
4241
use Symfony\Component\Serializer\Tests\Fixtures\Php74Dummy;
4342
use Symfony\Component\Serializer\Tests\Fixtures\Php74DummyPrivate;
@@ -731,20 +730,6 @@ public function testDoesntHaveIssuesWithUnionConstTypes()
731730
})::class)->foo);
732731
}
733732

734-
/**
735-
* @group legacy
736-
*/
737-
public function testExtractAttributesRespectsFormat()
738-
{
739-
$normalizer = new FormatAndContextAwareNormalizer();
740-
741-
$data = new ObjectDummy();
742-
$data->setFoo('bar');
743-
$data->bar = 'foo';
744-
745-
$this->assertSame(['foo' => 'bar', 'bar' => 'foo'], $normalizer->normalize($data, 'foo_and_bar_included'));
746-
}
747-
748733
public function testExtractAttributesRespectsContext()
749734
{
750735
$normalizer = new ObjectNormalizer();

src/Symfony/Component/Serializer/Tests/SerializerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testItThrowsExceptionOnInvalidEncoder()
8989
public function testNormalizeNoMatch()
9090
{
9191
$this->expectException(UnexpectedValueException::class);
92-
$serializer = new Serializer([$this->createMock(CustomNormalizer::class)]);
92+
$serializer = new Serializer([$this->createMock(NormalizerInterface::class)]);
9393
$serializer->normalize(new \stdClass(), 'xml');
9494
}
9595

@@ -117,7 +117,7 @@ public function testNormalizeOnDenormalizer()
117117
public function testDenormalizeNoMatch()
118118
{
119119
$this->expectException(UnexpectedValueException::class);
120-
$serializer = new Serializer([$this->createMock(CustomNormalizer::class)]);
120+
$serializer = new Serializer([$this->createMock(NormalizerInterface::class)]);
121121
$serializer->denormalize('foo', 'stdClass');
122122
}
123123

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