示例#1
0
 public function testHasChild()
 {
     $this->if($generator = new asserter\generator())->and($parent = new CrawlerAssert($generator))->and($object = new TestedClass($generator, $parent))->and($crawler = new \mock\Symfony\Component\DomCrawler\Crawler())->and($object->setWith($crawler))->then->exception(function () use($object) {
         $object->hasChild(uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('Expected at least %d element(s) matching %s, found %d.'), 1, '*', 0))->if($this->calling($crawler)->count = 1)->then->object($element = $object->hasChild(uniqid()))->isInstanceOf('\\atoum\\AtoumBundle\\Test\\Asserters\\Element')->object($element->getParent())->isIdenticalTo($object);
 }