Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
1fafa401
Commit
1fafa401
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix test on currency name
parent
32ff0912
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/lib/company.lib.php
+2
-0
2 additions, 0 deletions
htdocs/core/lib/company.lib.php
test/phpunit/CompanyLibTest.php
+1
-2
1 addition, 2 deletions
test/phpunit/CompanyLibTest.php
with
3 additions
and
2 deletions
htdocs/core/lib/company.lib.php
+
2
−
0
View file @
1fafa401
...
...
@@ -434,6 +434,8 @@ function currency_name($code_iso, $withcode='', $outputlangs=null)
if
(
empty
(
$outputlangs
))
$outputlangs
=
$langs
;
$outputlangs
->
load
(
"dict"
);
// If there is a translation, we can send immediatly the label
if
(
$outputlangs
->
trans
(
"Currency"
.
$code_iso
)
!=
"Currency"
.
$code_iso
)
{
...
...
This diff is collapsed.
Click to expand it.
test/phpunit/CompanyLibTest.php
+
1
−
2
View file @
1fafa401
...
...
@@ -129,11 +129,10 @@ class CompanyLibTest extends PHPUnit_Framework_TestCase
$result
=
currency_name
(
'USD'
);
print
__METHOD__
.
" result="
.
$result
.
"
\n
"
;
$this
->
assertEquals
(
'U
nited States
Dollar'
,
$result
,
'Test to get currency name USD in default language '
.
$langs
->
defaultlang
);
$this
->
assertEquals
(
'U
S
Dollar
s
'
,
$result
,
'Test to get currency name USD in default language '
.
$langs
->
defaultlang
);
$outputlangs
=
new
Translate
(
''
,
$conf
);
$outputlangs
->
setDefaultLang
(
'fr_FR'
);
$outputlangs
->
load
(
"dict"
);
$result
=
currency_name
(
'USD'
,
1
,
$outputlangs
);
print
__METHOD__
.
" result="
.
$result
.
"
\n
"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment