diff options
author | vrioux <vrioux@ctech.ca> | 2016-09-28 17:42:19 -0400 |
---|---|---|
committer | vrioux <vrioux@ctech.ca> | 2016-09-28 17:42:19 -0400 |
commit | 2a96e2cf287b9298853e4bb82a849a658cca4b9e (patch) | |
tree | af5e36d4bce0e3fb39fd2be5c1759a62f3f5a4bf | |
parent | 8a11719cea33536e92d083664caf2c5a61d5312f (diff) | |
download | simplesamlphp-2a96e2cf287b9298853e4bb82a849a658cca4b9e.zip simplesamlphp-2a96e2cf287b9298853e4bb82a849a658cca4b9e.tar.gz simplesamlphp-2a96e2cf287b9298853e4bb82a849a658cca4b9e.tar.bz2 |
added a bit more test coverage, I think
-rw-r--r-- | tests/modules/consent/lib/Auth/Process/ConsentTest.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/modules/consent/lib/Auth/Process/ConsentTest.php b/tests/modules/consent/lib/Auth/Process/ConsentTest.php index 704140a..fd17281 100644 --- a/tests/modules/consent/lib/Auth/Process/ConsentTest.php +++ b/tests/modules/consent/lib/Auth/Process/ConsentTest.php @@ -43,8 +43,11 @@ class ConsentTest extends \PHPUnit_Framework_TestCase 'metadata-set' => 'saml20-idp-local', 'consent.disable' => array( 'https://valid.flatstring.example.that.does.not.match', + array(), // invalid consent option array should be ignored + array('type'=>'invalid'), // invalid consent option type should be ignored + array('type'=>'regex'), // regex consent option without pattern should be ignored array('type'=>'regex', 'pattern'=>'/.*\.valid.regex\.that\.does\.not\.match.*/i'), - 'https://sp.example.org/my-sp', + 'https://sp.example.org/my-sp', // accept the SP that has this specific entityid ), 'SingleSignOnService' => array( array( @@ -54,7 +57,7 @@ class ConsentTest extends \PHPUnit_Framework_TestCase ), ), 'Destination' => array( - 'entityid' => 'https://sp.example.org/my-sp', + 'entityid' => 'https://sp.example.org/my-sp', // valid entityid equal to the last one in the consent.disable array 'metadata-set' => 'saml20-sp-remote', ), 'UserID' => 'jdoe', @@ -71,9 +74,7 @@ class ConsentTest extends \PHPUnit_Framework_TestCase 'entityid' => 'https://idp.example.org', 'metadata-set' => 'saml20-idp-local', 'consent.disable' => array( - 'https://valid.flatstring.example.that.does.not.match', - array('type'=>'regex', 'pattern'=>'/.*\.valid.regex\.that\.does\.not\.match.*/i'), - array('type'=>'regex', 'pattern'=>'/.*\.example\.org.*/i'), + array('type'=>'regex', 'pattern'=>'/.*\.example\.org.*/i'), // accept any SP that has an entityid that contains the string ".example.org" ), 'SingleSignOnService' => array( array( @@ -83,7 +84,7 @@ class ConsentTest extends \PHPUnit_Framework_TestCase ), ), 'Destination' => array( - 'entityid' => 'https://sp.example.org/my-sp', + 'entityid' => 'https://sp.example.org/my-sp', // sp contains the string ".example.org" 'metadata-set' => 'saml20-sp-remote', ), 'UserID' => 'jdoe', |