From 1c5775cb26f8e24f73fae89229b889de334dcd29 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Thu, 16 Jan 2020 10:03:04 +0100 Subject: [PATCH] add tests for invalid prefixes & suffixes --- tests/ValidatorTest.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php index f01d394..8391de2 100644 --- a/tests/ValidatorTest.php +++ b/tests/ValidatorTest.php @@ -9,8 +9,6 @@ /** * Class ValidatorTest * @package DvK\Tests\Vat - * - * Todo: Tests for validate method */ class ValidatorTest extends TestCase { @@ -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) {