Skip to content

Commit 9144065

Browse files
xabbuhnicolas-grekas
authored andcommitted
[Form] ensure compatibility with older PHPUnit mocks
1 parent a4b11d1 commit 9144065

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Tests/Validator/TraceableValidatorTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\Validator\Constraint;
1616
use Symfony\Component\Validator\ConstraintViolation;
1717
use Symfony\Component\Validator\ConstraintViolationList;
18-
use Symfony\Component\Validator\ConstraintViolationListInterface;
1918
use Symfony\Component\Validator\Context\ExecutionContextInterface;
2019
use Symfony\Component\Validator\Mapping\MetadataInterface;
2120
use Symfony\Component\Validator\Validator\ContextualValidatorInterface;
@@ -87,13 +86,13 @@ public function testForwardsToOriginalValidator()
8786
$expects('startContext')->willReturn($expected = $this->createMock(ContextualValidatorInterface::class));
8887
$this->assertSame($expected, $validator->startContext(), 'returns original validator startContext() result');
8988

90-
$expects('validate')->willReturn($expected = $this->createMock(ConstraintViolationListInterface::class));
89+
$expects('validate')->willReturn($expected = new ConstraintViolationList());
9190
$this->assertSame($expected, $validator->validate('value'), 'returns original validator validate() result');
9291

93-
$expects('validateProperty')->willReturn($expected = $this->createMock(ConstraintViolationListInterface::class));
92+
$expects('validateProperty')->willReturn($expected = new ConstraintViolationList());
9493
$this->assertSame($expected, $validator->validateProperty(new \stdClass(), 'property'), 'returns original validator validateProperty() result');
9594

96-
$expects('validatePropertyValue')->willReturn($expected = $this->createMock(ConstraintViolationListInterface::class));
95+
$expects('validatePropertyValue')->willReturn($expected = new ConstraintViolationList());
9796
$this->assertSame($expected, $validator->validatePropertyValue(new \stdClass(), 'property', 'value'), 'returns original validator validatePropertyValue() result');
9897
}
9998

0 commit comments

Comments
 (0)