Skip to content

Commit

Permalink
bug #24900 [Validator] Fix Costa Rica IBAN format (Bozhidar Hristov)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.7 branch (closes #24900).

Discussion
----------

[Validator] Fix Costa Rica IBAN format

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

Fix Costa Rica IBAN format: https://bank.codes/iban/structure/costa-rica/

Commits
-------

b9b5e18f8b [Validator] Fix Costa Rica IBAN format
  • Loading branch information
fabpot committed Nov 10, 2017
2 parents a02f368 + c1fba44 commit 1722865
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Constraints/IbanValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class IbanValidator extends ConstraintValidator
'CH' => 'CH\d{2}\d{5}[\dA-Z]{12}', // Switzerland
'CI' => 'CI\d{2}[A-Z]{1}\d{23}', // Ivory Coast
'CM' => 'CM\d{2}\d{23}', // Cameron
'CR' => 'CR\d{2}\d{3}\d{14}', // Costa Rica
'CR' => 'CR\d{2}0\d{3}\d{14}', // Costa Rica
'CV' => 'CV\d{2}\d{21}', // Cape Verde
'CY' => 'CY\d{2}\d{3}\d{5}[\dA-Z]{16}', // Cyprus
'CZ' => 'CZ\d{2}\d{20}', // Czech Republic
Expand Down
5 changes: 3 additions & 2 deletions Tests/Constraints/IbanValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function getValidIbans()
array('CV64000300004547069110176'), //Cape Verde
array('FR7630007000110009970004942'), //Central African Republic
array('CG5230011000202151234567890'), //Congo
array('CR0515202001026284066'), //Costa Rica
array('CR05015202001026284066'), //Costa Rica
array('DO28BAGR00000001212453611324'), //Dominican Republic
array('GT82TRAJ01020000001210029690'), //Guatemala
array('IR580540105180021273113007'), //Iran
Expand Down Expand Up @@ -253,6 +253,7 @@ public function getIbansWithInvalidFormat()
array('FR76300070001100099700049421'), //Central African Republic
array('CG52300110002021512345678901'), //Congo
array('CR05152020010262840661'), //Costa Rica
array('CR0515202001026284066'), //Costa Rica
array('DO28BAGR000000012124536113241'), //Dominican Republic
array('GT82TRAJ010200000012100296901'), //Guatemala
array('IR5805401051800212731130071'), //Iran
Expand Down Expand Up @@ -363,7 +364,7 @@ public function getIbansWithValidFormatButIncorrectChecksum()
array('CV64000300004547069110177'), //Cape Verde
array('FR7630007000110009970004943'), //Central African Republic
array('CG5230011000202151234567891'), //Congo
array('CR0515202001026284067'), //Costa Rica
array('CR96042332432534543564'), //Costa Rica
array('DO28BAGR00000001212453611325'), //Dominican Republic
array('GT82TRAJ01020000001210029691'), //Guatemala
array('IR580540105180021273113008'), //Iran
Expand Down

0 comments on commit 1722865

Please sign in to comment.