Skip to content

Commit

Permalink
add tests for invalid prefixes & suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Jan 16, 2020
1 parent 094c3b8 commit 1c5775c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
/**
* Class ValidatorTest
* @package DvK\Tests\Vat
*
* Todo: Tests for validate method
*/
class ValidatorTest extends TestCase
{
Expand Down Expand Up @@ -92,8 +90,21 @@ public function testValidateVatNumberFormat()
'SE12345678901',
'SI1234567',
'SK123456789',
'fooGB999999973', // valid VAT number but with string prefix

// valid number but with prefix
'invalid_prefix_GB999999973',
'invalid_prefix_IE1234567X',
'invalid_prefix_ESB1234567C',
'invalid_prefix_BE0123456789',
'invalid_prefix_MT12345678',
'invalid_prefix_LT123456789',

// valid number but with suffix
'IE1234567X_invalid_suffix',
'ESB1234567C_invalid_suffix',
'BE0123456789_invalid_suffix',
'MT12345678_invalid_suffix',
'LT123456789_invalid_suffix',
];

foreach ($invalid as $format) {
Expand Down

0 comments on commit 1c5775c

Please sign in to comment.