Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
0b1501e8
Commit
0b1501e8
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Tests for SimpleSAML\Locale\Language::isLanguageRTL() + Typo.
parent
79b9a26e
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
lib/SimpleSAML/Locale/Language.php
+1
-1
1 addition, 1 deletion
lib/SimpleSAML/Locale/Language.php
tests/lib/SimpleSAML/Locale/LanguageTest.php
+30
-0
30 additions, 0 deletions
tests/lib/SimpleSAML/Locale/LanguageTest.php
with
31 additions
and
1 deletion
lib/SimpleSAML/Locale/Language.php
+
1
−
1
View file @
0b1501e8
...
...
@@ -153,7 +153,7 @@ class Language
continue
;
}
/* Some user agents use very limited preci
c
ion of the quality value, but order the elements in descending
/* Some user agents use very limited preci
s
ion of the quality value, but order the elements in descending
* order. Therefore we rely on the order of the output from getAcceptLanguage() matching the order of the
* languages in the header when two languages have the same quality.
*/
...
...
This diff is collapsed.
Click to expand it.
tests/lib/SimpleSAML/Locale/LanguageTest.php
+
30
−
0
View file @
0b1501e8
...
...
@@ -71,6 +71,36 @@ class LanguageTest extends \PHPUnit_Framework_TestCase
}
/**
* Test SimpleSAML\Locale\Language::isLanguageRTL().
*/
public
function
testIsLanguageRTL
()
{
// test defaults
$c
=
\SimpleSAML_Configuration
::
loadFromArray
(
array
(),
''
,
'simplesaml'
);
$l
=
new
Language
(
$c
);
$l
->
setLanguage
(
'en'
);
$this
->
assertFalse
(
$l
->
isLanguageRTL
());
// test non-defaults, non-RTL
$c
=
\SimpleSAML_Configuration
::
loadFromArray
(
array
(
'language.rtl'
=>
array
(
'xx'
,
'yy'
,
'zz'
),
),
''
,
'simplesaml'
);
$l
=
new
Language
(
$c
);
$l
->
setLanguage
(
'en'
);
$this
->
assertFalse
(
$l
->
isLanguageRTL
());
// test non-defaults, RTL
$c
=
\SimpleSAML_Configuration
::
loadFromArray
(
array
(
'language.available'
=>
array
(
'xx'
,
'yy'
,
'zz'
,
'en'
),
'language.rtl'
=>
array
(
'xx'
,
'yy'
),
),
''
,
'simplesaml'
);
$l
=
new
Language
(
$c
);
$l
->
setLanguage
(
'yy'
);
$this
->
assertTrue
(
$l
->
isLanguageRTL
());
}
/**
* Test SimpleSAML\Locale\Language::setLanguage().
*/
...
...
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