Skip to content

Commit 7fcb72b

Browse files
minor #57559 [Serializer] Check if exception message in test is correct (HypeMC)
This PR was merged into the 5.4 branch. Discussion ---------- [Serializer] Check if exception message in test is correct | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix #57427 (just test) | License | MIT This is a test for #57433 Commits ------- 2fc8789 [Serializer] Check if exception message in test is correct
2 parents 7ee6bec + 2fc8789 commit 7fcb72b

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 = [])
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
@@ -514,6 +514,7 @@ public function testDenormalizeUntypedFormat()
514514
public function testDenormalizeUntypedFormatNotNormalizable()
515515
{
516516
$this->expectException(NotNormalizableValueException::class);
517+
$this->expectExceptionMessage('Custom exception message');
517518
$serializer = new Serializer([new CustomNormalizer(), new ObjectNormalizer(null, null, null, new PropertyInfoExtractor([], [new PhpDocExtractor(), new ReflectionExtractor()]))]);
518519
$serializer->denormalize(['value' => 'test'], DummyWithNotNormalizable::class, 'xml');
519520
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy