PHP Class SAML2\AssertionTest

Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: simplesamlphp/saml2

Public Methods

Method 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 method

An assertion must always be version "2.0".

testAssertionWithoutIDthrowsException() public method

An assertion without an ID must throw an exception

testAssertionWithoutIssuerThrowsException() public method

An assertion must always have an Issuer element.

testAttributeValuesWithComplexTypesAreParsedCorrectly() public method

testAuthnContextDeclAndClassRef() public method

Test parsing AuthnContext elements Decl and ClassRef

testAuthnContextDeclAndRefConstraint() public method

testAuthnContextDeclRefAndClassRef() public method

Test parsing AuthnContext elements DeclRef and ClassRef

testConditionAllowedTypes() public method

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

testConditionWithUnknownNamespaceThrowsException() public method

A Condition must be of namespace saml.

testCorrectSignatureMethodCanBeExtracted() public method

testEncryptedAttributeValuesWithComplexTypeValuesAreParsedCorrectly() public method

testEptiAttributeParsingSupportsMultipleValues() public method

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

testEptiAttributeValuesAreParsedCorrectly() public method

testEptiAttributeValuesMustBeANameID() public method

testHasEncryptedAttributes() public method

testMarshalling() public method

Test to build a basic assertion
public testMarshalling ( )

testMarshallingUnmarshallingChristmas() public method

Test an assertion with lots of options

testMissingAuthnContextThrowsException() public method

No AuthnContext inside AuthnStatement will throw Exception.

testMissingAuthnInstantThrowsException() public method

AuthnStatement must have AuthnInstant attribute, if missing throw Exception.

testMissingNameOnAttribute() public method

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

testMixedAttributeNameFormats() public method

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

testMoreThanOneAuthnContextClassRefThrowsException() public method

More than one AuthnContextClassRef inside AuthnContext will throw Exception.

testMoreThanOneAuthnContextDeclRefThrowsException() public method

More than one AuthnContextDeclRef inside AuthnContext will throw Exception.

testMoreThanOneAuthnContextDeclThrowsException() public method

More than one AuthnContextDecl inside AuthnContext will throw Exception.

testMoreThanOneAuthnContextThrowsException() public method

More than one AuthnContext inside AuthnStatement will throw Exception.

testMoreThanOneAuthnStatementThrowsException() public method

More than one AuthnStatement will throw Exception.

testMoreThanOneNameIDThrowsException() public method

No more than one NameID may be present in the Subject

testMoreThanOneSubjectThrowsException() public method

More than one is not allowed in an Assertion.

testMustHaveClassRefOrDeclOrDeclRef() public method

testNameIDunmarshalling() public method

Test basic NameID unmarshalling.

testNameIdEncryption() public method

Test NameID Encryption and Decryption.

testNoAuthnContextDeclRefFallback() public method

This tests against reintroduction of removed behavior.

testRetrieveEncryptedNameIdException() public method

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

testSetAuthnContextDecl() public method

Test setting an AuthnContextDecl chunk.

testSubjectMustHaveNameIDorSubjectConfirmation() public method

A wtthout both NameID and SubjectConfirmation throws exception.

testTooManyConditionsThrowsException() public method

An Assertion may not have more than one

testTypedAttributeValuesAreParsedCorrectly() public method

testTypedEncryptedAttributeValuesAreParsedCorrectly() public method

testUnkownThrowsException() public method

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

testUnmarshalling() public method

Test to parse a basic assertion
public testUnmarshalling ( )

testVerifySignedAssertion() public method

Try to verify a signed assertion.

testVerifySignedAssertionChangedBody() public method

Must yield a validation exception.

testVerifySignedAssertionWrongKey() public method

Must yield a signature validation exception.

testVerifyUnsignedAssertion() public method

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