Example #1
0
 public function testChildren()
 {
     $this->given($document = new \DOMDocument())->if($node = $document->createElement(uniqid('_')))->and($child = $document->createElement(uniqid('_')))->and($node->appendChild($child))->and($crawler = new \Symfony\Component\DomCrawler\Crawler(array($node)))->and($object = new TestedClass($crawler))->then->object($children = $object->children())->isInstanceOf('\\Symfony\\Component\\DomCrawler\\Crawler')->boolean($children->contains($child))->isTrue()->if($object = new TestedClass($node))->then->object($children = $object->children())->isInstanceOf('\\Symfony\\Component\\DomCrawler\\Crawler')->boolean($children->contains($child))->isTrue();
 }