Skip to content

Commit

Permalink
[Validator] Fix Costa Rica IBAN format
Browse files Browse the repository at this point in the history
  • Loading branch information
Bozhidar Hristov authored and fabpot committed Nov 10, 2017
1 parent 338597c commit c1fba44
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 @@ -57,7 +57,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 @@ -132,7 +132,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 @@ -246,6 +246,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 @@ -355,7 +356,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 c1fba44

Please sign in to comment.