@@ -125,8 +125,8 @@ public function testNormalizeGivesPriorityToInterfaceOverTraversable()
125
125
public function testNormalizeOnDenormalizer ()
126
126
{
127
127
$ 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 ' );
130
130
}
131
131
132
132
public function testDeno
8000
rmalizeNoMatch ()
@@ -149,8 +149,8 @@ public function testDenormalizeOnNormalizer()
149
149
$ serializer = new Serializer ([], [], new ChainNormalizer ([new TestNormalizer ()]));
150
150
$ data = ['title ' => 'foo ' , 'numbers ' => [5 , 3 ]];
151
151
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 ' );
154
154
}
155
155
156
156
public function testCustomNormalizerCanNormalizeCollectionsAndScalar ()
@@ -1221,7 +1221,7 @@ public function testCollectDenormalizationErrorsWithoutTypeExtractor()
1221
1221
"float": []
1222
1222
} ' ;
1223
1223
1224
- $ serializer = new Serializer ([new ObjectNormalizer () ], ['json ' => new JsonEncoder ()]);
1224
+ $ serializer = new Serializer ([], ['json ' => new JsonEncoder ()], new ChainNormalizer ([ new ObjectNormalizer ()]), new ChainDenormalizer ([ new ObjectNormalizer ()]) );
1225
1225
1226
1226
try {
1227
1227
$ serializer ->deserialize ($ json , Php74Full::class, 'json ' , [
@@ -1669,9 +1669,12 @@ public function testPartialDenormalizationWithMissingConstructorTypes()
1669
1669
1670
1670
$ extractor = new PropertyInfoExtractor ([], [new ReflectionExtractor ()]);
1671
1671
1672
+ $ objectNormalizer = new ObjectNormalizer (null , null , null , $ extractor );
1672
1673
$ 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 ]),
1675
1678
);
1676
1679
1677
1680
try {
0 commit comments