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

testUnmarshalling() public method

Test unmarshalling a basic DiscoHints element
public testUnmarshalling ( )
    public function testUnmarshalling()
    {
        $document = DOMDocumentFactory::fromString(<<<XML
<mdui:DiscoHints xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui">
  <mdui:IPHint>130.59.0.0/16</mdui:IPHint>
  <mdui:IPHint>2001:620::0/96</mdui:IPHint>
  <mdui:DomainHint>example.com</mdui:DomainHint>
  <mdui:DomainHint>www.example.com</mdui:DomainHint>
  <mdui:GeolocationHint>geo:47.37328,8.531126</mdui:GeolocationHint>
  <mdui:GeolocationHint>geo:19.34343,12.342514</mdui:GeolocationHint>
</mdui:DiscoHints>
XML
);
        $disco = new DiscoHints($document->firstChild);
        $this->assertCount(2, $disco->IPHint);
        $this->assertEquals('130.59.0.0/16', $disco->IPHint[0]);
        $this->assertEquals('2001:620::0/96', $disco->IPHint[1]);
        $this->assertCount(2, $disco->DomainHint);
        $this->assertEquals('example.com', $disco->DomainHint[0]);
        $this->assertEquals('www.example.com', $disco->DomainHint[1]);
        $this->assertCount(2, $disco->GeolocationHint);
        $this->assertEquals('geo:47.37328,8.531126', $disco->GeolocationHint[0]);
        $this->assertEquals('geo:19.34343,12.342514', $disco->GeolocationHint[1]);
    }