PHP Class SAML2\AssertionTest

Inheritance: extends PHPUnit_Framework_TestCase
Afficher le fichier Open project: simplesamlphp/saml2

Méthodes publiques

Méthode Description
testAssertionVersionOtherThan20ThrowsException ( ) An assertion must always be version "2.0".
testAssertionWithoutIDthrowsException ( ) An assertion without an ID must throw an exception
testAssertionWithoutIssuerThrowsException ( ) An assertion must always have an Issuer element.
testAttributeValuesWithComplexTypesAreParsedCorrectly ( )
testAuthnContextDeclAndClassRef ( ) Test parsing AuthnContext elements Decl and ClassRef
testAuthnContextDeclAndRefConstraint ( )
testAuthnContextDeclRefAndClassRef ( ) Test parsing AuthnContext elements DeclRef and ClassRef
testConditionAllowedTypes ( ) Test various types of allowed Conditions.
testConditionWithUnknownNamespaceThrowsException ( ) A Condition must be of namespace saml.
testCorrectSignatureMethodCanBeExtracted ( )
testEncryptedAttributeValuesWithComplexTypeValuesAreParsedCorrectly ( )
testEptiAttributeParsingSupportsMultipleValues ( ) as per http://software.internet2.edu/eduperson/internet2-mace-dir-eduperson-201310.html#eduPersonTargetedID it is multivalued
testEptiAttributeValuesAreParsedCorrectly ( )
testEptiAttributeValuesMustBeANameID ( )
testHasEncryptedAttributes ( )
testMarshalling ( ) Test to build a basic assertion
testMarshallingUnmarshallingChristmas ( ) Test an assertion with lots of options
testMissingAuthnContextThrowsException ( ) No AuthnContext inside AuthnStatement will throw Exception.
testMissingAuthnInstantThrowsException ( ) AuthnStatement must have AuthnInstant attribute, if missing throw Exception.
testMissingNameOnAttribute ( ) When an Attribute element has no name, exception is thrown.
testMixedAttributeNameFormats ( ) If this assertion mixes Attribute NameFormats, the AttributeNameFormat of this assertion will be set to unspecified.
testMoreThanOneAuthnContextClassRefThrowsException ( ) More than one AuthnContextClassRef inside AuthnContext will throw Exception.
testMoreThanOneAuthnContextDeclRefThrowsException ( ) More than one AuthnContextDeclRef inside AuthnContext will throw Exception.
testMoreThanOneAuthnContextDeclThrowsException ( ) More than one AuthnContextDecl inside AuthnContext will throw Exception.
testMoreThanOneAuthnContextThrowsException ( ) More than one AuthnContext inside AuthnStatement will throw Exception.
testMoreThanOneAuthnStatementThrowsException ( ) More than one AuthnStatement will throw Exception.
testMoreThanOneNameIDThrowsException ( ) No more than one NameID may be present in the Subject
testMoreThanOneSubjectThrowsException ( ) More than one is not allowed in an Assertion.
testMustHaveClassRefOrDeclOrDeclRef ( )
testNameIDunmarshalling ( ) Test basic NameID unmarshalling.
testNameIdEncryption ( ) Test NameID Encryption and Decryption.
testNoAuthnContextDeclRefFallback ( ) Tests that AuthnContextDeclRef is not mistaken for AuthnContextClassRef.
testRetrieveEncryptedNameIdException ( ) Test Exception when trying to get encrypted NameId without decrypting it first.
testSetAuthnContextDecl ( ) Test setting an AuthnContextDecl chunk.
testSubjectMustHaveNameIDorSubjectConfirmation ( ) A wtthout both NameID and SubjectConfirmation throws exception.
testTooManyConditionsThrowsException ( ) An Assertion may not have more than one
testTypedAttributeValuesAreParsedCorrectly ( )
testTypedEncryptedAttributeValuesAreParsedCorrectly ( )
testUnkownThrowsException ( ) Any Condition other than AudienceRestirction, OneTimeUse and ProxyRestriction must throw an Exception.
testUnmarshalling ( ) Test to parse a basic assertion
testVerifySignedAssertion ( ) Try to verify a signed assertion.
testVerifySignedAssertionChangedBody ( ) Try to verify a signed assertion in which a byte was changed after signing.
testVerifySignedAssertionWrongKey ( ) Try to verify a signed assertion with the wrong key.
testVerifyUnsignedAssertion ( ) Calling validate on an unsigned assertion must return false, not an exception.

Method Details

testAssertionVersionOtherThan20ThrowsException() public méthode

An assertion must always be version "2.0".

testAssertionWithoutIDthrowsException() public méthode

An assertion without an ID must throw an exception

testAssertionWithoutIssuerThrowsException() public méthode

An assertion must always have an Issuer element.

testAttributeValuesWithComplexTypesAreParsedCorrectly() public méthode

testAuthnContextDeclAndClassRef() public méthode

Test parsing AuthnContext elements Decl and ClassRef

testAuthnContextDeclAndRefConstraint() public méthode

testAuthnContextDeclRefAndClassRef() public méthode

Test parsing AuthnContext elements DeclRef and ClassRef

testConditionAllowedTypes() public méthode

- AudienceRestriction: are ANDed together so should only be audience1 - OneTimeUse and ProxyRestrictions must be accepted but are currently a no-op.

testConditionWithUnknownNamespaceThrowsException() public méthode

A Condition must be of namespace saml.

testCorrectSignatureMethodCanBeExtracted() public méthode

testEncryptedAttributeValuesWithComplexTypeValuesAreParsedCorrectly() public méthode

testEptiAttributeParsingSupportsMultipleValues() public méthode

as per http://software.internet2.edu/eduperson/internet2-mace-dir-eduperson-201310.html#eduPersonTargetedID it is multivalued

testEptiAttributeValuesAreParsedCorrectly() public méthode

testEptiAttributeValuesMustBeANameID() public méthode

testHasEncryptedAttributes() public méthode

testMarshalling() public méthode

Test to build a basic assertion
public testMarshalling ( )

testMarshallingUnmarshallingChristmas() public méthode

Test an assertion with lots of options

testMissingAuthnContextThrowsException() public méthode

No AuthnContext inside AuthnStatement will throw Exception.

testMissingAuthnInstantThrowsException() public méthode

AuthnStatement must have AuthnInstant attribute, if missing throw Exception.

testMissingNameOnAttribute() public méthode

When an Attribute element has no name, exception is thrown.

testMixedAttributeNameFormats() public méthode

If this assertion mixes Attribute NameFormats, the AttributeNameFormat of this assertion will be set to unspecified.

testMoreThanOneAuthnContextClassRefThrowsException() public méthode

More than one AuthnContextClassRef inside AuthnContext will throw Exception.

testMoreThanOneAuthnContextDeclRefThrowsException() public méthode

More than one AuthnContextDeclRef inside AuthnContext will throw Exception.

testMoreThanOneAuthnContextDeclThrowsException() public méthode

More than one AuthnContextDecl inside AuthnContext will throw Exception.

testMoreThanOneAuthnContextThrowsException() public méthode

More than one AuthnContext inside AuthnStatement will throw Exception.

testMoreThanOneAuthnStatementThrowsException() public méthode

More than one AuthnStatement will throw Exception.

testMoreThanOneNameIDThrowsException() public méthode

No more than one NameID may be present in the Subject

testMoreThanOneSubjectThrowsException() public méthode

More than one is not allowed in an Assertion.

testMustHaveClassRefOrDeclOrDeclRef() public méthode

testNameIDunmarshalling() public méthode

Test basic NameID unmarshalling.

testNameIdEncryption() public méthode

Test NameID Encryption and Decryption.

testNoAuthnContextDeclRefFallback() public méthode

This tests against reintroduction of removed behavior.

testRetrieveEncryptedNameIdException() public méthode

Test Exception when trying to get encrypted NameId without decrypting it first.

testSetAuthnContextDecl() public méthode

Test setting an AuthnContextDecl chunk.

testSubjectMustHaveNameIDorSubjectConfirmation() public méthode

A wtthout both NameID and SubjectConfirmation throws exception.

testTooManyConditionsThrowsException() public méthode

An Assertion may not have more than one

testTypedAttributeValuesAreParsedCorrectly() public méthode

testTypedEncryptedAttributeValuesAreParsedCorrectly() public méthode

testUnkownThrowsException() public méthode

Any Condition other than AudienceRestirction, OneTimeUse and ProxyRestriction must throw an Exception.

testUnmarshalling() public méthode

Test to parse a basic assertion
public testUnmarshalling ( )

testVerifySignedAssertion() public méthode

Try to verify a signed assertion.

testVerifySignedAssertionChangedBody() public méthode

Must yield a validation exception.

testVerifySignedAssertionWrongKey() public méthode

Must yield a signature validation exception.

testVerifyUnsignedAssertion() public méthode

Calling validate on an unsigned assertion must return false, not an exception.