Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03bd90a

Browse files
committed
Add a test
1 parentbb99e1c commit03bd90a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ public function testDenormalizeStringCollectionDecodedFromXmlWithTwoChildren()
163163
$this->assertEquals('bar',$stringCollection->children[1]);
164164
}
165165

166+
publicfunctiontestDenormalizeNotSerializableObjectToPopulate()
167+
{
168+
$normalizer =newAbstractObjectNormalizerDummy();
169+
$normalizedData =$normalizer->denormalize(['foo' =>'foo'], Dummy::class,null, [AbstractObjectNormalizer::OBJECT_TO_POPULATE =>newNotSerializable()]);
170+
171+
$this->assertSame('foo',$normalizedData->foo);
172+
}
173+
166174
privatefunctiongetDenormalizerForStringCollection()
167175
{
168176
$extractor =$this->getMockBuilder(PhpDocExtractor::class)->getMock();
@@ -379,3 +387,15 @@ public function setSerializer(SerializerInterface $serializer)
379387
$this->serializer =$serializer;
380388
}
381389
}
390+
391+
class NotSerializable
392+
{
393+
publicfunction__sleep()
394+
{
395+
if (class_exists(\Error::class)) {
396+
thrownew \Error('not serializable');
397+
}
398+
399+
thrownew \Exception('not serializable');
400+
}
401+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp