SAML2\XML\mdrpi\PublicationInfoTest::testUnmarshalling PHP Метод

testUnmarshalling() публичный Метод

public testUnmarshalling ( )
    public function testUnmarshalling()
    {
        $document = DOMDocumentFactory::fromString(<<<XML
<mdrpi:PublicationInfo xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
                       publisher="SomePublisher"
                       creationInstant="2011-01-01T00:00:00Z"
                       publicationId="SomePublicationId">
    <mdrpi:UsagePolicy xml:lang="en">http://TheEnglishUsagePolicy</mdrpi:UsagePolicy>
    <mdrpi:UsagePolicy xml:lang="no">http://TheNorwegianUsagePolicy</mdrpi:UsagePolicy>
</mdrpi:PublicationInfo>
XML
);
        $publicationInfo = new PublicationInfo($document->firstChild);
        $this->assertEquals('SomePublisher', $publicationInfo->publisher);
        $this->assertEquals(1293840000, $publicationInfo->creationInstant);
        $this->assertEquals('SomePublicationId', $publicationInfo->publicationId);
        $this->assertCount(2, $publicationInfo->UsagePolicy);
        $this->assertEquals('http://TheEnglishUsagePolicy', $publicationInfo->UsagePolicy["en"]);
        $this->assertEquals('http://TheNorwegianUsagePolicy', $publicationInfo->UsagePolicy["no"]);
    }