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
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
ceabb113
Commit
ceabb113
authored
9 years ago
by
Thijs Kinkhorst
Browse files
Options
Downloads
Patches
Plain Diff
Also test some lines missed with these tests
parent
1b867d20
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/modules/core/lib/Auth/Process/AttributeAddTest.php
+1
-1
1 addition, 1 deletion
tests/modules/core/lib/Auth/Process/AttributeAddTest.php
tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
+24
-1
24 additions, 1 deletion
tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
with
25 additions
and
2 deletions
tests/modules/core/lib/Auth/Process/AttributeAddTest.php
+
1
−
1
View file @
ceabb113
...
@@ -163,7 +163,7 @@ class Test_Core_Auth_Process_AttributeAdd extends PHPUnit_Framework_TestCase
...
@@ -163,7 +163,7 @@ class Test_Core_Auth_Process_AttributeAdd extends PHPUnit_Framework_TestCase
{
{
$config
=
array
(
$config
=
array
(
'%replace'
,
'%replace'
,
array
(
'value2'
),
true
=>
array
(
'value2'
),
);
);
$request
=
array
(
$request
=
array
(
'Attributes'
=>
array
(
'Attributes'
=>
array
(
...
...
This diff is collapsed.
Click to expand it.
tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
+
24
−
1
View file @
ceabb113
...
@@ -43,7 +43,7 @@ class Test_Core_Auth_Process_ScopeAttribute extends PHPUnit_Framework_TestCase
...
@@ -43,7 +43,7 @@ class Test_Core_Auth_Process_ScopeAttribute extends PHPUnit_Framework_TestCase
}
}
/*
/*
* If
scop
e already set, module must add, not overwrite.
* If
target attribut
e already set, module must add, not overwrite.
*/
*/
public
function
testNoOverwrite
()
public
function
testNoOverwrite
()
{
{
...
@@ -64,6 +64,29 @@ class Test_Core_Auth_Process_ScopeAttribute extends PHPUnit_Framework_TestCase
...
@@ -64,6 +64,29 @@ class Test_Core_Auth_Process_ScopeAttribute extends PHPUnit_Framework_TestCase
$this
->
assertEquals
(
$attributes
[
'eduPersonScopedAffiliation'
],
array
(
'library-walk-in@example.edu'
,
'member@example.com'
));
$this
->
assertEquals
(
$attributes
[
'eduPersonScopedAffiliation'
],
array
(
'library-walk-in@example.edu'
,
'member@example.com'
));
}
}
/*
* If same scope already set, module must do nothing, not duplicate value.
*/
public
function
testNoDuplication
()
{
$config
=
array
(
'scopeAttribute'
=>
'eduPersonPrincipalName'
,
'sourceAttribute'
=>
'eduPersonAffiliation'
,
'targetAttribute'
=>
'eduPersonScopedAffiliation'
,
);
$request
=
array
(
'Attributes'
=>
array
(
'eduPersonPrincipalName'
=>
array
(
'jdoe@example.com'
),
'eduPersonAffiliation'
=>
array
(
'member'
),
'eduPersonScopedAffiliation'
=>
array
(
'member@example.com'
),
)
);
$result
=
self
::
processFilter
(
$config
,
$request
);
$attributes
=
$result
[
'Attributes'
];
$this
->
assertEquals
(
$attributes
[
'eduPersonScopedAffiliation'
],
array
(
'member@example.com'
));
}
/*
/*
* If source attribute not set, nothing happens
* If source attribute not set, nothing happens
*/
*/
...
...
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