bug #24904 [Validator] Add Belarus IBAN format (Bozhidar Hristov)

This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Add Belarus IBAN format

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | no
| License       | MIT
| Doc PR        | no

Add missing Belarus IBAN format - https://bank.codes/iban/structure/belarus/

Commits
-------

128f2fa14e [Validator] Add Belarus IBAN format
This commit is contained in:
Fabien Potencier 2017-11-10 07:10:39 -08:00
commit 470629045b
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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