Skip to content

Commit 260468a

Browse files
fix tests now Constraint class does not set options as properties
1 parent f3238e6 commit 260468a

2 files changed

Lines changed: 7 additions & 13 deletions

File tree

tests/Validator/Constraints/VatNumberExceptionValidatorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ public function testViesExceptionValid()
3232

3333
public function testViesExceptionError()
3434
{
35-
$constraint = new VatNumber([
36-
'violateOnException' => true,
37-
]);
35+
$constraint = new VatNumber();
36+
$constraint->violateOnException = true;
3837
$this->validator->validate('IE6388047V', $constraint);
3938
$this->buildViolation('An error occurred while checking VAT number, please try again later')
4039
->setCode('a1be6ee0-f27e-4d51-a132-f0a753c0b01e')

tests/Validator/Constraints/VatNumberValidatorTest.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ public function testGoogleIrelandIsValid()
3838
*/
3939
public function testInvalidValues($value)
4040
{
41-
$constraint = new VatNumber([
42-
'message' => 'myMessage',
43-
]);
41+
$constraint = new VatNumber();
42+
$constraint->message = 'myMessage';
4443
$this->validator->validate($value, $constraint);
4544
$this->buildViolation('myMessage')
4645
->setParameter('{{ string }}', $value)
@@ -50,13 +49,9 @@ public function testInvalidValues($value)
5049

5150
public static function getInvalidValues()
5251
{
53-
return [
52+
return [
5453
['NL123'],
5554
['DE500'],
56-
];
55+
];
5756
}
58-
59-
60-
61-
62-
}
57+
}

0 commit comments

Comments
 (0)