コード例 #1
0
ファイル: getStringTest.php プロジェクト: bogdananton/vsc
 public function testGetString()
 {
     $value = 'test';
     $o = new XmlReader();
     $o->setString($value);
     $this->assertEquals($value, $o->getString());
 }
コード例 #2
0
ファイル: buildObjTest.php プロジェクト: bogdananton/vsc
 public function testBuildObjectFromIncompleteXml()
 {
     $value = '<t>test</t>';
     $o = new XmlReader();
     $o->setString($value);
     $o->buildObj();
     $this->assertInstanceOf(\DOMDocument::class, $o->getDom());
     $this->assertContains($value, $o->getDom()->saveXML());
     // the output xml contains the XML header
 }
コード例 #3
0
ファイル: RssReader.php プロジェクト: bogdananton/vsc
 public function buildObj()
 {
     parent::buildObj();
     $oNode = $this->getDom()->getElementsByTagName('channel')->item(0);
     if ($oNode instanceof \DOMElement) {
         $this->parseToEntity($oNode->childNodes);
     }
 }
コード例 #4
0
ファイル: getDomTest.php プロジェクト: bogdananton/vsc
 public function testEmptyAtInitialization()
 {
     $o = new XmlReader();
     $this->assertNull($o->getDom());
 }