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