|
21 | 21 | use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent; |
22 | 22 | use Symfony\Component\HttpKernel\Exception\HttpException; |
23 | 23 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
| 24 | +use Symfony\Component\PropertyAccess\Exception\InvalidTypeException; |
24 | 25 | use Symfony\Component\Serializer\Encoder\JsonEncoder; |
25 | 26 | use Symfony\Component\Serializer\Encoder\XmlEncoder; |
26 | 27 | use Symfony\Component\Serializer\Exception\PartialDenormalizationException; |
@@ -253,7 +254,7 @@ public function testValidationNotPassed() |
253 | 254 | $validationFailedException = $e->getPrevious(); |
254 | 255 | $this->assertSame(422, $e->getStatusCode()); |
255 | 256 | $this->assertInstanceOf(ValidationFailedException::class, $validationFailedException); |
256 | | - $this->assertSame('This value should be of type unknown.', $validationFailedException->getViolations()[0]->getMessage()); |
| 257 | + $this->assertSame(sprintf('This value should be of type %s.', class_exists(InvalidTypeException::class) ? 'string' : 'unknown'), $validationFailedException->getViolations()[0]->getMessage()); |
257 | 258 | $this->assertSame('Test', $validationFailedException->getViolations()[1]->getMessage()); |
258 | 259 | } |
259 | 260 | } |
@@ -665,7 +666,7 @@ public function testRequestPayloadValidationErrorCustomStatusCode() |
665 | 666 | $validationFailedException = $e->getPrevious(); |
666 | 667 | $this->assertSame(400, $e->getStatusCode()); |
667 | 668 | $this->assertInstanceOf(ValidationFailedException::class, $validationFailedException); |
668 | | - $this->assertSame('This value should be of type unknown.', $validationFailedException->getViolations()[0]->getMessage()); |
| 669 | + $this->assertSame(sprintf('This value should be of type %s.', class_exists(InvalidTypeException::class) ? 'string' : 'unknown'), $validationFailedException->getViolations()[0]->getMessage()); |
669 | 670 | $this->assertSame('Test', $validationFailedException->getViolations()[1]->getMessage()); |
670 | 671 | } |
671 | 672 | } |
|
0 commit comments