public function testIssuerParsedAsNameID()
{
$authnRequest = new \DOMDocument();
$authnRequest->loadXML(<<<'AUTHNREQUEST'
<samlp:AuthnRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
AssertionConsumerServiceIndex="1"
Destination="https://tiqr.stepup.org/idp/profile/saml2/Redirect/SSO"
ID="_2b0226190ca1c22de6f66e85f5c95158"
IssueInstant="2014-09-22T13:42:00Z"
Version="2.0">
<saml:Issuer NameQualifier="https://gateway.stepup.org/saml20/sp/metadata"
SPNameQualifier="https://spnamequalifier.com"
SPProvidedID="ProviderID"
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">
https://gateway.stepup.org/saml20/sp/metadata
</saml:Issuer>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">[email protected]</saml:NameID>
</saml:Subject>
</samlp:AuthnRequest>
AUTHNREQUEST
);
$message = Message::fromXML($authnRequest->documentElement);
$issuer = $message->getIssuer();
$this->assertInstanceOf('SAML2\\XML\\saml\\Issuer', $issuer);
$this->assertEquals('https://gateway.stepup.org/saml20/sp/metadata', $issuer->NameQualifier);
$this->assertEquals('https://spnamequalifier.com', $issuer->SPNameQualifier);
$this->assertEquals('ProviderID', $issuer->SPProvidedID);
$this->assertEquals('urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified', $issuer->Format);
$this->assertEquals('https://gateway.stepup.org/saml20/sp/metadata', $issuer->value);
}