/** * 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(); }
/** * 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; }