예제 #1
0
    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());
    }
예제 #2
0
파일: Query.php 프로젝트: beberlei/phpricot
 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;
 }