SAML2\XML\mdui\KeywordsTest::testMarshalling PHP Method

testMarshalling() public method

Test creating a basic Keywords element.
public testMarshalling ( )
    public function testMarshalling()
    {
        $keywords = new Keywords();
        $keywords->lang = "en";
        $keywords->Keywords = array("KLM", "royal", "Dutch", "air lines");
        $document = DOMDocumentFactory::fromString('<root />');
        $xml = $keywords->toXML($document->firstChild);
        $keywordElements = Utils::xpQuery($xml, '/root/*[local-name()=\'Keywords\' and namespace-uri()=\'urn:oasis:names:tc:SAML:metadata:ui\']');
        $this->assertCount(1, $keywordElements);
        $keywordElement = $keywordElements[0];
        $this->assertEquals("KLM royal Dutch air+lines", $keywordElement->textContent);
        $this->assertEquals("en", $keywordElement->getAttribute('xml:lang'));
    }