Skip to content

Commit 474fa5f

Browse files
committed
fix tests
1 parent 9c6e76e commit 474fa5f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -665,14 +665,11 @@ public function testQueryValidationErrorCustomStatusCode()
665665
public function testRequestPayloadValidationErrorCustomStatusCode()
666666
{
667667
$content = '{"price": 50, "title": ["not a string"]}';
668-
$payload = new RequestPayload(50);
669668
$serializer = new Serializer([new ObjectNormalizer()], ['json' => new JsonEncoder()]);
670669

671670
$validator = $this->createMock(ValidatorInterface::class);
672-
$validator->expects($this->once())
673-
->method('validate')
674-
->with($payload)
675-
->willReturn(new ConstraintViolationList([new ConstraintViolation('Test', null, [], '', null, '')]));
671+
$validator->expects($this->never())
672+
->method('validate');
676673

677674
$resolver = new RequestPayloadValueResolver($serializer, $validator);
678675

@@ -693,7 +690,6 @@ public function testRequestPayloadValidationErrorCustomStatusCode()
693690
$this->assertSame(400, $e->getStatusCode());
694691
$this->assertInstanceOf(ValidationFailedException::class, $validationFailedException);
695692
$this->assertSame(sprintf('This value should be of type %s.', class_exists(InvalidTypeException::class) ? 'string' : 'unknown'), $validationFailedException->getViolations()[0]->getMessage());
696-
$this->assertSame('Test', $validationFailedException->getViolations()[1]->getMessage());
697693
}
698694
}
699695
}

0 commit comments

Comments
 (0)