public function testList() { $query = new PHPricot_Query('<ul><li>Foo</li><li>Bar</li></ul>'); $expected = <<<ETT * Foo * Bar ETT; $this->assertEquals($expected, $query->getDocument()->toText()); }
public function before($input) { if (!$input instanceof PHPricot_Query) { $input = new PHPricot_Query($input); } foreach ($this->_getChildElements() as $element) { $pos = array_search($element, $element->parent->childNodes); array_splice($element->parent->childNodes, $pos, 1, array_merge($input->getDocument()->childNodes, array($element))); } return $this; }