Fix test on currency name
This commit is contained in:
parent
32ff09123d
commit
1fafa4017d
@ -434,6 +434,8 @@ function currency_name($code_iso, $withcode='', $outputlangs=null)
|
|||||||
|
|
||||||
if (empty($outputlangs)) $outputlangs=$langs;
|
if (empty($outputlangs)) $outputlangs=$langs;
|
||||||
|
|
||||||
|
$outputlangs->load("dict");
|
||||||
|
|
||||||
// If there is a translation, we can send immediatly the label
|
// If there is a translation, we can send immediatly the label
|
||||||
if ($outputlangs->trans("Currency".$code_iso)!="Currency".$code_iso)
|
if ($outputlangs->trans("Currency".$code_iso)!="Currency".$code_iso)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -129,11 +129,10 @@ class CompanyLibTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$result=currency_name('USD');
|
$result=currency_name('USD');
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertEquals('United States Dollar',$result,'Test to get currency name USD in default language '.$langs->defaultlang);
|
$this->assertEquals('US Dollars',$result,'Test to get currency name USD in default language '.$langs->defaultlang);
|
||||||
|
|
||||||
$outputlangs=new Translate('', $conf);
|
$outputlangs=new Translate('', $conf);
|
||||||
$outputlangs->setDefaultLang('fr_FR');
|
$outputlangs->setDefaultLang('fr_FR');
|
||||||
$outputlangs->load("dict");
|
|
||||||
|
|
||||||
$result=currency_name('USD', 1, $outputlangs);
|
$result=currency_name('USD', 1, $outputlangs);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user