Example #1
0
 public function test__construct()
 {
     $this->if($node = new \StdClass())->then->exception(function () use($node) {
         new TestedClass($node);
     })->isInstanceOf('\\InvalidArgumentException')->hasMessage('Node should be an instance of either \\DOMNode or \\Symfony\\Component\\DomCrawler\\Crawler')->if($node = new \DOMElement(uniqid('_')))->then->object($object = new TestedClass($node))->object($object->getNode())->isIdenticalTo($node)->if($crawler = new \Symfony\Component\DomCrawler\Crawler())->then->object($object = new TestedClass($crawler))->object($object->getNode())->isIdenticalTo($crawler);
 }