Skip to content

Commit 1c5775c

Browse files
add tests for invalid prefixes & suffixes
1 parent 094c3b8 commit 1c5775c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/ValidatorTest.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
/**
1010
* Class ValidatorTest
1111
* @package DvK\Tests\Vat
12-
*
13-
* Todo: Tests for validate method
1412
*/
1513
class ValidatorTest extends TestCase
1614
{
@@ -92,8 +90,21 @@ public function testValidateVatNumberFormat()
9290
'SE12345678901',
9391
'SI1234567',
9492
'SK123456789',
95-
'fooGB999999973', // valid VAT number but with string prefix
93+
94+
// valid number but with prefix
95+
'invalid_prefix_GB999999973',
96+
'invalid_prefix_IE1234567X',
97+
'invalid_prefix_ESB1234567C',
98+
'invalid_prefix_BE0123456789',
99+
'invalid_prefix_MT12345678',
100+
'invalid_prefix_LT123456789',
101+
102+
// valid number but with suffix
103+
'IE1234567X_invalid_suffix',
96104
'ESB1234567C_invalid_suffix',
105+
'BE0123456789_invalid_suffix',
106+
'MT12345678_invalid_suffix',
107+
'LT123456789_invalid_suffix',
97108
];
98109

99110
foreach ($invalid as $format) {

0 commit comments

Comments
 (0)