Skip to content

Commit

Permalink
Add some tests for iban_get_nationalchecksum_part()
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Stanish committed Jan 29, 2016
1 parent 65d58d4 commit bf430d5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions utils/other-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,25 @@
$i++;
}

# === iban_get_nationalchecksum_part ========================
$test_data = array( # input => # expected output
'AL47212110090000000235698741' => '9',
'ES9121000418450200051332' => '45'
);
$i=0;
foreach($test_data as $input=>$expected_output) {
print " - iban_get_nationalchecksum_part() test #$i... ";
$received_output = iban_get_nationalchecksum_part($input);
if($received_output != $expected_output) {
print "FAILED (expected '$expected_output', received '$received_output')\n";
exit(1);
}
else {
print "OK.\n";
}
$i++;
}

print "All tests passed.\n";
exit(0);
?>

0 comments on commit bf430d5

Please sign in to comment.