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 committed Jun 27, 2024
1 parent 3fd3eca commit c97dba5
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 = [])
{
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 @@ -514,6 +514,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 c97dba5

Please sign in to comment.