addNodes() 공개 메소드

Adds an array of \DOMNode instances to the list of nodes.
public addNodes ( array $nodes )
$nodes array An array of \DOMNode instances
예제 #1
0
 public function testAddNodes()
 {
     $list = array();
     foreach ($this->createNodeList() as $node) {
         $list[] = $node;
     }
     $crawler = new Crawler();
     $crawler->addNodes($list);
     $this->assertEquals('foo', $crawler->filterXPath('//div')->attr('class'), '->addNodes() adds nodes from an array of nodes');
 }
예제 #2
0
 /**
  * @covers Symfony\Component\DomCrawler\Crawler::addNodes
  */
 public function testAddNodes()
 {
     if (!class_exists('Symfony\\Component\\CssSelector\\CssSelector')) {
         $this->markTestSkipped('The "CssSelector" component is not available');
     }
     foreach ($this->createNodeList() as $node) {
         $list[] = $node;
     }
     $crawler = new Crawler();
     $crawler->addNodes($list);
     $this->assertEquals('foo', $crawler->filter('div')->attr('class'), '->addNodes() adds nodes from an array of nodes');
 }