SAML2\XML\mdui\UIInfoTest::testUnmarshalling PHP Method

testUnmarshalling() public method

Test unmarshalling a basic UIInfo element
public testUnmarshalling ( )
    public function testUnmarshalling()
    {
        $document = DOMDocumentFactory::fromString(<<<XML
<mdui:UIInfo xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui">
  <mdui:DisplayName xml:lang="en">University of Examples</mdui:DisplayName>
  <mdui:DisplayName xml:lang="el">Univërsitä øf Exåmpleß</mdui:DisplayName>
  <mdui:InformationURL xml:lang="en">http://www.example.edu/en/</mdui:InformationURL>
  <mdui:InformationURL xml:lang="el">http://www.example.edu/</mdui:InformationURL>
  <mdui:Description xml:lang="en">Just an example</mdui:Description>
  <mdui:PrivacyStatementURL xml:lang="en">https://example.org/privacy</mdui:PrivacyStatementURL>
</mdui:UIInfo>
XML
);
        $uiinfo = new UIInfo($document->firstChild);
        $this->assertCount(2, $uiinfo->DisplayName);
        $this->assertEquals('University of Examples', $uiinfo->DisplayName['en']);
        $this->assertEquals('Univërsitä øf Exåmpleß', $uiinfo->DisplayName['el']);
        $this->assertCount(2, $uiinfo->InformationURL);
        $this->assertEquals('http://www.example.edu/en/', $uiinfo->InformationURL['en']);
        $this->assertEquals('http://www.example.edu/', $uiinfo->InformationURL['el']);
        $this->assertCount(1, $uiinfo->PrivacyStatementURL);
        $this->assertEquals('https://example.org/privacy', $uiinfo->PrivacyStatementURL['en']);
        $this->assertCount(1, $uiinfo->Description);
        $this->assertEquals('Just an example', $uiinfo->Description['en']);
    }