From 128f2fa14e290f9d4f694fede9e237fa865df751 Mon Sep 17 00:00:00 2001 From: Bozhidar Hristov Date: Fri, 10 Nov 2017 14:40:09 +0200 Subject: [PATCH] [Validator] Add Belarus IBAN format --- .../Component/Validator/Constraints/IbanValidator.php | 1 + .../Validator/Tests/Constraints/IbanValidatorTest.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/Symfony/Component/Validator/Constraints/IbanValidator.php b/src/Symfony/Component/Validator/Constraints/IbanValidator.php index 329d630a5a..4a97d588cb 100644 --- a/src/Symfony/Component/Validator/Constraints/IbanValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IbanValidator.php @@ -51,6 +51,7 @@ class IbanValidator extends ConstraintValidator 'BH' => 'BH\d{2}[A-Z]{4}[\dA-Z]{14}', // Bahrain 'BI' => 'BI\d{2}\d{12}', // Burundi 'BJ' => 'BJ\d{2}[A-Z]{1}\d{23}', // Benin + 'BY' => 'BY\d{2}[\dA-Z]{4}\d{4}[\dA-Z]{16}', // Belarus - https://bank.codes/iban/structure/belarus/ 'BL' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Saint Barthelemy 'BR' => 'BR\d{2}\d{8}\d{5}\d{10}[A-Z][\dA-Z]', // Brazil 'CG' => 'CG\d{2}\d{23}', // Congo diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php index f16dafd827..fb4c915587 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php @@ -68,6 +68,9 @@ class IbanValidatorTest extends AbstractConstraintValidatorTest array('BE62 5100 0754 7061'), //Belgium array('BA39 1290 0794 0102 8494'), //Bosnia and Herzegovina array('BG80 BNBG 9661 1020 3456 78'), //Bulgaria + array('BY 13 NBRB 3600 900000002Z00AB00'), //Belarus + array('BY13 NBRB 3600 900000002Z00AB00'), //Belarus + array('BY22NB23324232T78YR7823HR32U'), //Belarus array('HR12 1001 0051 8630 0016 0'), //Croatia array('CY17 0020 0128 0000 0012 0052 7600'), //Cyprus array('CZ65 0800 0000 1920 0014 5399'), //Czech Republic @@ -183,6 +186,10 @@ class IbanValidatorTest extends AbstractConstraintValidatorTest array('BA39 1290 0794 0102 8494 4'), //Bosnia and Herzegovina array('BG80 BNBG 9661 1020 3456 7'), //Bulgaria array('BG80 B2BG 9661 1020 3456 78'), //Bulgaria + array('BY 13 NBRB 3600 900000002Z00AB001'), //Belarus + array('BY 13 NBRB 3600 900000002Z00AB0'), //Belarus + array('BYRO NBRB 3600 900000002Z00AB0'), //Belarus + array('BY 13 3600 NBRB 900000002Z00AB05'), //Belarus array('HR12 1001 0051 8630 0016 01'), //Croatia array('CY17 0020 0128 0000 0012 0052 7600 1'), //Cyprus array('CZ65 0800 0000 1920 0014 5399 1'), //Czech Republic @@ -293,6 +300,7 @@ class IbanValidatorTest extends AbstractConstraintValidatorTest array('BE62 5100 0754 7062'), //Belgium array('BA39 1290 0794 0102 8495'), //Bosnia and Herzegovina array('BG80 BNBG 9661 1020 3456 79'), //Bulgaria + array('BY90 NBRB 3600 900000002Z00AB00'), //Belarus array('HR12 1001 0051 8630 0016 1'), //Croatia array('CY17 0020 0128 0000 0012 0052 7601'), //Cyprus array('CZ65 0800 0000 1920 0014 5398'), //Czech Republic