} # === iban_country_get_iana ================================== $test_data = array('AA' => '', 'XK' => '', 'BL' => '', 'MF' => '', 'MQ' => 'mq', 'GB' => 'uk'); $i = 0; foreach ($test_data as $input => $expected_output) { print " - iban_country_get_iana() test #{$i}... "; $received_output = iban_country_get_iana($input); if ($received_output != $expected_output) { print "FAILED (expected '{$expected_output}', received '{$received_output}')\n"; exit(1); } else { print "OK.\n"; } $i++; } # === iban_country_get_iso3166 ============================== $test_data = array('AA' => '', 'XK' => '', 'GB' => 'GB'); $i = 0; foreach ($test_data as $input => $expected_output) { print " - iban_country_get_iso3166() test #{$i}... "; $received_output = iban_country_get_iso3166($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);
public function ISO3166() { return iban_country_get_iso3166($this->code); }