Prewk\XmlStringStreamerIntegrationTest::test_createStringWalkerParser_convenience_method_with_pubmed_xml PHP Метод

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

    public function test_createStringWalkerParser_convenience_method_with_pubmed_xml()
    {
        $file = __DIR__ . "/../../xml/pubmed-example.xml";
        $streamer = XmlStringStreamer::createStringWalkerParser($file);
        $expectedPMIDs = array("24531174", "24529294", "24449586");
        $foundPMIDs = array();
        while ($node = $streamer->getNode()) {
            $xmlNode = simplexml_load_string($node);
            $foundPMIDs[] = (string) $xmlNode->MedlineCitation->PMID;
        }
        $this->assertEquals($expectedPMIDs, $foundPMIDs, "The PMID nodes should be as expected");
    }