Skip to content

Commit

Permalink
Update tests for partial-implementations (no set) eg. NL MOD11
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Stanish committed Feb 19, 2016
1 parent 395f840 commit 8508a11
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions utils/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,21 @@
else {
print " (National checksum manually validated.)\n";
}
# also check 'verify' codepath
if(!iban_verify_nationalchecksum($iban)) {
}
# also check 'verify' codepath
$result = iban_verify_nationalchecksum($iban);
if($result!='') {
if($result!=true) {
print " (ERROR: iban_verify_nationalchecksum($iban) did not validate!)\n";
exit(1);
}
else {
print " (National checksum automatically validated.)\n";
}
# also check 'set' codepath
$fixed_iban = iban_set_nationalchecksum($iban);
}
# also check 'set' codepath
$fixed_iban = iban_set_nationalchecksum($iban);
if($fixed_iban != '') {
if($fixed_iban != $iban) {
print " (ERROR: iban_set_nationalchecksum('$iban') returned '$fixed_iban')\n";
exit(1);
Expand Down

0 comments on commit 8508a11

Please sign in to comment.