diff --git a/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php b/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php index 2f032248b866d..331c2a529d8c0 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php @@ -665,14 +665,11 @@ public function testQueryValidationErrorCustomStatusCode() public function testRequestPayloadValidationErrorCustomStatusCode() { $content = '{"price": 50, "title": ["not a string"]}'; - $payload = new RequestPayload(50); $serializer = new Serializer([new ObjectNormalizer()], ['json' => new JsonEncoder()]); $validator = $this->createMock(ValidatorInterface::class); - $validator->expects($this->once()) - ->method('validate') - ->with($payload) - ->willReturn(new ConstraintViolationList([new ConstraintViolation('Test', null, [], '', null, '')])); + $validator->expects($this->never()) + ->method('validate'); $resolver = new RequestPayloadValueResolver($serializer, $validator); @@ -693,7 +690,6 @@ public function testRequestPayloadValidationErrorCustomStatusCode() $this->assertSame(400, $e->getStatusCode()); $this->assertInstanceOf(ValidationFailedException::class, $validationFailedException); $this->assertSame(sprintf('This value should be of type %s.', class_exists(InvalidTypeException::class) ? 'string' : 'unknown'), $validationFailedException->getViolations()[0]->getMessage()); - $this->assertSame('Test', $validationFailedException->getViolations()[1]->getMessage()); } } }