Prewk\XmlStringStreamer\Parser\UniqueNodeTest::test_uniqueNode_shortClosing_setting PHP Метод

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

    public function test_uniqueNode_shortClosing_setting()
    {
        $node1 = <<<eot
            <child foo="Lorem" index="1" />
eot;
        $node2 = <<<eot
            <child>
                <foo baz="attribute">Lorem</foo>
                <bar>Ipsum</bar>
                <index>2</index>
            </child>
eot;
        $node3 = <<<eot
            <child foo="Lorem" index="3" />
eot;
        $xml = <<<eot
            <?xml version="1.0"?>
            <root>
                {$node1}
                {$node2}
                {$node3}
            </root>
eot;
        $stream = $this->getStreamMock($xml, 50);
        $parser = new UniqueNode(array("uniqueNode" => "child", 'checkShortClosing' => true));
        $this->assertEquals(trim($node1), trim($parser->getNodeFrom($stream)), "Node 1 should be obtained on the first getNodeFrom");
        $this->assertEquals(trim($node2), trim($parser->getNodeFrom($stream)), "Node 2 should be obtained on the first getNodeFrom");
        $this->assertEquals(trim($node3), trim($parser->getNodeFrom($stream)), "Node 3 should be obtained on the first getNodeFrom");
    }