| @@ 79-90 (lines=12) @@ | ||
| 76 | /** |
|
| 77 | * @dataProvider getNoneStrictInvalidPeselNumbers |
|
| 78 | */ |
|
| 79 | public function testInvalidPesel($pesel) |
|
| 80 | { |
|
| 81 | $constraint = new Pesel(array( |
|
| 82 | 'message' => 'myMessage', |
|
| 83 | )); |
|
| 84 | ||
| 85 | $this->validator->validate($pesel, $constraint); |
|
| 86 | ||
| 87 | $this->buildViolation('myMessage') |
|
| 88 | ->setParameter('{{ value }}', '"' . $pesel . '"') |
|
| 89 | ->assertRaised(); |
|
| 90 | } |
|
| 91 | ||
| 92 | /** |
|
| 93 | * @dataProvider getStrictInvalidPeselNumbers |
|
| @@ 95-107 (lines=13) @@ | ||
| 92 | /** |
|
| 93 | * @dataProvider getStrictInvalidPeselNumbers |
|
| 94 | */ |
|
| 95 | public function testInvalidPeselStrict($pesel) |
|
| 96 | { |
|
| 97 | $constraint = new Pesel(array( |
|
| 98 | 'strict' => true, |
|
| 99 | 'message' => 'myMessage', |
|
| 100 | )); |
|
| 101 | ||
| 102 | $this->validator->validate($pesel, $constraint); |
|
| 103 | ||
| 104 | $this->buildViolation('myMessage') |
|
| 105 | ->setParameter('{{ value }}', '"' . $pesel . '"') |
|
| 106 | ->assertRaised(); |
|
| 107 | } |
|
| 108 | ||
| 109 | /** |
|
| 110 | * @return array |
|
| @@ 59-70 (lines=12) @@ | ||
| 56 | /** |
|
| 57 | * @dataProvider getInvalidRegonNumbers |
|
| 58 | */ |
|
| 59 | public function testInvalidRegon($regon) |
|
| 60 | { |
|
| 61 | $constraint = new Regon(array( |
|
| 62 | 'message' => 'myMessage', |
|
| 63 | )); |
|
| 64 | ||
| 65 | $this->validator->validate($regon, $constraint); |
|
| 66 | ||
| 67 | $this->buildViolation('myMessage') |
|
| 68 | ->setParameter('{{ value }}', '"' . $regon . '"') |
|
| 69 | ->assertRaised(); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * @return array |
|