8000 Fix tests · symfony/symfony@a36a11a · GitHub
[go: up one dir, main page]

Skip to content

Commit a36a11a

Browse files
committed
Fix tests
1 parent 05d22f8 commit a36a11a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ public function testNormalizeGivesPriorityToInterfaceOverTraversable()
125125
public function testNormalizeOnDenormalizer()
126126
{
127127
$serializer = new Serializer([], [], null, new ChainDenormalizer([new TestDenormalizer()]));
128-
$this->expectException(UnexpectedValueException::class);
129-
$this->assertTrue($serializer->normalize(new \stdClass(), 'json'));
128+
$this->expectException(LogicException::class);
129+
$serializer->normalize(new \stdClass(), 'json');
130130
}
131131

132132
public function testDeno 8000 rmalizeNoMatch()
@@ -149,8 +149,8 @@ public function testDenormalizeOnNormalizer()
149149
$serializer = new Serializer([], [], new ChainNormalizer([new TestNormalizer()]));
150150
$data = ['title' => 'foo', 'numbers' => [5, 3]];
151151

152-
$this->expectException(UnexpectedValueException::class);
153-
$this->assertTrue($serializer->denormalize(json_encode($data), 'stdClass', 'json'));
152+
$this->expectException(LogicException::class);
153+
$serializer->denormalize(json_encode($data), 'stdClass', 'json');
154154
}
155155

156156
public function testCustomNormalizerCanNormalizeCollectionsAndScalar()
@@ -1221,7 +1221,7 @@ public function testCollectDenormalizationErrorsWithoutTypeExtractor()
12211221
"float": []
12221222
}';
12231223

1224-
$serializer = new Serializer([new ObjectNormalizer()], ['json' => new JsonEncoder()]);
1224+
$serializer = new Serializer([], ['json' => new JsonEncoder()], new ChainNormalizer([new ObjectNormalizer()]), new ChainDenormalizer([new ObjectNormalizer()]));
12251225

12261226
try {
12271227
$serializer->deserialize($json, Php74Full::class, 'json', [
@@ -1669,9 +1669,12 @@ public function testPartialDenormalizationWithMissingConstructorTypes()
16691669

16701670
$extractor = new PropertyInfoExtractor([], [new ReflectionExtractor()]);
16711671

1672+
$objectNormalizer = new ObjectNormalizer(null, null, null, $extractor);
16721673
$serializer = new Serializer(
1673-
[new ObjectNormalizer(null, null, null, $extractor)],
1674-
['json' => new JsonEncoder()]
1674+
[],
1675+
['json' => new JsonEncoder()],
1676+
new ChainNormalizer([$objectNormalizer]),
1677+
new ChainDenormalizer([$objectNormalizer]),
16751678
);
16761679

16771680
try {

0 commit comments

Comments
 (0)
0