Skip to content

Commit

Permalink
[Serializer] Check if exception message in test is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
HypeMC authored and xabbuh committed Jun 27, 2024
1 parent 6266026 commit 7d12e1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Tests/Fixtures/NotNormalizableDummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public function __construct()

public function denormalize(DenormalizerInterface $denormalizer, $data, ?string $format = null, array $context = []): void
{
throw new NotNormalizableValueException();
throw new NotNormalizableValueException('Custom exception message');
}
}
1 change: 1 addition & 0 deletions Tests/Normalizer/AbstractObjectNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ public function testDenormalizeUntypedFormat()
public function testDenormalizeUntypedFormatNotNormalizable()
{
$this->expectException(NotNormalizableValueException::class);
$this->expectExceptionMessage('Custom exception message');
$serializer = new Serializer([new CustomNormalizer(), new ObjectNormalizer(null, null, null, new PropertyInfoExtractor([], [new PhpDocExtractor(), new ReflectionExtractor()]))]);
$serializer->denormalize(['value' => 'test'], DummyWithNotNormalizable::class, 'xml');
}
Expand Down

0 comments on commit 7d12e1a

Please sign in to comment.