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
486bd878
Commit
486bd878
authored
9 years ago
by
Jaime Perez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Tests for SimpleSAML\Locale\Language::getLanguageList().
parent
0b1501e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lib/SimpleSAML/Locale/LanguageTest.php
+26
-1
26 additions, 1 deletion
tests/lib/SimpleSAML/Locale/LanguageTest.php
with
26 additions
and
1 deletion
tests/lib/SimpleSAML/Locale/LanguageTest.php
+
26
−
1
View file @
486bd878
...
...
@@ -47,11 +47,36 @@ class LanguageTest extends \PHPUnit_Framework_TestCase
'language.available'
=>
array
(
'xx'
,
'yy'
,
'zz'
),
'language.cookie.name'
=>
'xyz'
),
''
,
'simplesaml'
);
$_COOKIE
[
'xyz'
]
=
'
y
y'
;
$_COOKIE
[
'xyz'
]
=
'
Y
y'
;
// test values are converted to lowercase too
$this
->
assertEquals
(
'yy'
,
Language
::
getLanguageCookie
());
}
/**
* Test SimpleSAML\Locale\Language::getLanguageList().
*/
public
function
testGetLanguageList
()
{
// test defaults
$c
=
\SimpleSAML_Configuration
::
loadFromArray
(
array
(),
''
,
'simplesaml'
);
$l
=
new
Language
(
$c
);
$l
->
setLanguage
(
'en'
);
$this
->
assertEquals
(
array
(
'en'
=>
true
),
$l
->
getLanguageList
());
// test non-defaults
$c
=
\SimpleSAML_Configuration
::
loadFromArray
(
array
(
'language.available'
=>
array
(
'xx'
,
'yy'
,
'zz'
),
),
''
,
'simplesaml'
);
$l
=
new
Language
(
$c
);
$l
->
setLanguage
(
'yy'
);
$this
->
assertEquals
(
array
(
'xx'
=>
false
,
'yy'
=>
true
,
'zz'
=>
false
,
),
$l
->
getLanguageList
());
}
/**
* Test SimpleSAML\Locale\Language::getLanguageParameterName().
*/
...
...
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