Ejemplo n.º 1
0
 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them in the $_entry array based upon DOM data.
  *
  * @param DOMNode $child The DOMNode to process
  */
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('yt') . ':' . 'status':
             $status = new Extension\Status();
             $status->transferFromDOM($child);
             $this->_status = $status;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Ejemplo n.º 2
0
 public function testConvertUserProfileEntryToAndFromStringV2()
 {
     $this->entry->transferFromXML($this->V2entryText);
     $entryXml = $this->entry->saveXML();
     $newUserProfileEntry = new YouTube\UserProfileEntry();
     $newUserProfileEntry->setMajorProtocolVersion(2);
     $newUserProfileEntry->transferFromXML($entryXml);
     $this->verifyAllSamplePropertiesAreCorrectV2($newUserProfileEntry);
     $newUserProfileEntryXml = $newUserProfileEntry->saveXML();
     $this->assertEquals($entryXml, $newUserProfileEntryXml);
 }