Ejemplo n.º 1
0
 public function testGetRoot()
 {
     $template = new atoum\template();
     $this->assert->object($template->getRoot())->isIdenticalTo($template);
     $template->addChild($childTemplate = new atoum\template());
     $this->assert->object($template->getRoot())->isIdenticalTo($template)->object($childTemplate->getRoot())->isIdenticalTo($template);
     $childTemplate->addChild($littleChildTemplate = new atoum\template());
     $this->assert->object($template->getRoot())->isIdenticalTo($template)->object($childTemplate->getRoot())->isIdenticalTo($template)->object($littleChildTemplate->getRoot())->isIdenticalTo($template);
 }
Ejemplo n.º 2
0
 public function testGetRoot()
 {
     $this->if($this->newTestedInstance)->then->object($this->testedInstance->getRoot())->isTestedInstance->if($this->testedInstance->addChild($childTemplate = new atoum\template()))->then->object($this->testedInstance->getRoot())->isTestedInstance->object($childTemplate->getRoot())->isTestedInstance->if($childTemplate->addChild($littleChildTemplate = new atoum\template()))->then->object($this->testedInstance->getRoot())->isTestedInstance->object($childTemplate->getRoot())->isTestedInstance->object($littleChildTemplate->getRoot())->isTestedInstance;
 }