function testAllLocales() { $locales = Numbers_Words::getLocales(); foreach ($locales as $locale) { $nw = new Numbers_Words(); $word = $nw->toWords(101, $locale); $this->assertNotEmpty($word, 'Word for "101" is empty in locale ' . $locale); } }
} elseif (isset($argv) && is_array($argv) && isset($argv[1])) { $num = $argv[1]; } $html_on = 0; $shownum = $num; while (strlen($shownum) % 3 != 0) { $shownum = " " . $shownum; } $shownum = ereg_replace("(...)", "\\1 ", $shownum); $shownum = ereg_replace(" \$", "", $shownum); if ($html_on) { echo "<center>Test number: <b><u>{$shownum}</u></b></center><p>\n"; } else { echo sprintf("%42s", 'Test number: ') . $shownum . "\n\n"; } $lang = Numbers_Words::getLocales(); $langs = array(); if ($html_on) { ?> <center> <table width="100%" border="1" cellspacing="0"> <tr> <th width="50">Symbol</th> <th width="100">Number system</th> <th width="100%">String</th> </tr> <?php } foreach ($lang as $loc_symbol) { $classname = "Numbers_Words_" . $loc_symbol; @(include_once "Numbers/Words/lang.{$loc_symbol}.php");