Skip to content
Snippets Groups Projects
Commit ceabb113 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Also test some lines missed with these tests

parent 1b867d20
No related branches found
No related tags found
No related merge requests found
...@@ -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(
......
...@@ -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 scope already set, module must add, not overwrite. * If target attribute 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
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment