Skip to content

Commit 514315f

Browse files
authored
Refactoring (#172)
1 parent 31bc7e3 commit 514315f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Tests/Validator/EnumValidatorTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,13 @@ public function testInvalidBasketballPositionType(): void
9191
$constraintValidationBuilder = $this->createMock(ConstraintViolationBuilder::class);
9292

9393
$constraintValidationBuilder
94-
->expects(self::at(0))
94+
->expects(self::exactly(2))
9595
->method('setParameter')
96-
->with(self::equalTo('{{ value }}'), self::equalTo('"Pitcher"'))
97-
->willReturnSelf()
98-
;
99-
100-
$constraintValidationBuilder
101-
->expects(self::at(1))
102-
->method('setParameter')
103-
->with(self::equalTo('{{ choices }}'), self::equalTo('"PG", "SG", "SF", "PF", "C"'))
104-
->willReturnSelf()
96+
->withConsecutive(
97+
[self::equalTo('{{ value }}'), self::equalTo('"Pitcher"')],
98+
[self::equalTo('{{ choices }}'), self::equalTo('"PG", "SG", "SF", "PF", "C"')]
99+
)
100+
->willReturn(self::returnSelf(), self::returnSelf())
105101
;
106102

107103
$constraintValidationBuilder

0 commit comments

Comments
 (0)