109 : void
110 {
111 $xml = <<<EOT
112<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
113 xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
114 xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
115 xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute"
116 xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
117 xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
118 <md:Extensions>
119 <mdrpi:RegistrationInfo registrationAuthority="https://registrar.example.net"/>
120 <mdrpi:PublicationInfo creationInstant="2017-08-16T19:10:29Z" publisher="https://registrar.example.net"/>
121 <mdattr:EntityAttributes>
122 <saml:Attribute Name="http://registrar.example.net/entity-category"
123 NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
124 <saml:AttributeValue>https:
125 </saml:Attribute>
126 </mdattr:EntityAttributes>
127 </md:Extensions>
128 <md:IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
129 <md:Extensions>
130 <mdui:UIInfo>
131 <mdui:DisplayName xml:lang="en">Example.org</mdui:DisplayName>
132 <mdui:Description xml:lang="en">The identity provider at Example.org</mdui:Description>
133 <mdui:Logo height="32" width="32" xml:lang="en">https:
134 </mdui:UIInfo>
135 </md:Extensions>
136 <md:KeyDescriptor use="signing">
137 <ds:KeyInfo>...</ds:KeyInfo>
138 </md:KeyDescriptor>
139 <md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
140 Location="https://idp.example.org/SAML2/SSO/Redirect"/>
141 <md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
142 Location="https://idp.example.org/SAML2/SSO/POST"/>
143 </md:IDPSSODescriptor>
144 <md:Organization>
145 <md:OrganizationName xml:lang="en">Example.org Non-Profit Org</md:OrganizationName>
146 <md:OrganizationDisplayName xml:lang="en">Example.org</md:OrganizationDisplayName>
147 <md:OrganizationURL xml:lang="en">https:
148 </md:Organization>
149 <md:ContactPerson contactType="technical">
150 <md:SurName>SAML Technical Support</md:SurName>
151 <md:EmailAddress>mailto:technical-support@example.org</md:EmailAddress>
152 </md:ContactPerson>
153</md:EntityDescriptor>
154EOT;
155
156 $result = $this->parser->parse($xml);
157
158 $this->assertTrue($result->isError());
159 $this->assertFalse($result->isOK());
160
161 $this->assertNotEmpty($result->error());
162 }