8000 [Serializer] Check if exception message in test is correct · symfony/symfony@71d67d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 71d67d4

Browse files
HypeMCxabbuh
authored andcommitted
[Serializer] Check if exception message in test is correct
1 parent 8650176 commit 71d67d4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public function __construct()
2626

2727
public function denormalize(DenormalizerInterface $denormalizer, $data, ?string $format = null, array $context = []): void
2828
{
29-
throw new NotNormalizableValueException();
29+
throw new NotNormalizableValueException('Custom exception message');
3030
}
3131
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,7 @@ public function testDenormalizeUntypedFormat()
946946
public function testDenormalizeUntypedFormatNotNormalizable()
947947
{
948948
$this->expectException(NotNormalizableValueException::class);
949+
$this->expectExceptionMessage('Custom exception message');
949950
$serializer = new Serializer([new CustomNormalizer(), new ObjectNormalizer(null, null, null, new PropertyInfoExtractor([], [new PhpDocExtractor(), new ReflectionExtractor()]))]);
950951
$serializer->denormalize(['value' => 'test'], DummyWithNotNormalizable::class, 'xml');
951952
}

0 commit comments

Comments
 (0)
0