예제 #1
0
 /**
  * This method is called after the last test of this test class is run.
  */
 protected function tearDown()
 {
     if ($this->dom) {
         $this->dom->clear();
     }
     $this->dom = null;
     gc_collect_cycles();
 }
예제 #2
0
파일: CDom.php 프로젝트: vponomarev/CDom
 /**
  * Prepares content, for manipulation.
  *
  * @param string|CDomNode|CDomNode[]|CDomDocument|CDomNodesList $content
  *
  * @return CDomNodesList|false returns FALSE if content is empty
  */
 protected function prepareContent($content)
 {
     if (!$content instanceof CDomNodesList) {
         // Document
         if ($content instanceof CDomDocument) {
             $content =& $content->detachChildren();
         } else {
             if (!is_object($content) && !is_array($content)) {
                 $content = CDom::fromString($content);
                 $content =& $content->detachChildren();
             }
         }
         $list = new self();
         $list->add($content);
         $content = $list;
     }
     return $content->length ? $content : false;
 }