Exemple #1
0
 public function testParentIsSet()
 {
     $template = new atoum\template();
     $this->assert->boolean($template->parentIsSet())->isFalse();
     $childTemplate = new atoum\template();
     $this->assert->boolean($template->parentIsSet())->isFalse()->boolean($childTemplate->parentIsSet())->isFalse();
     $template->addChild($childTemplate);
     $this->assert->boolean($template->parentIsSet())->isFalse()->boolean($childTemplate->parentIsSet())->isTrue();
     $littleChildTemplate = new atoum\template();
     $this->assert->boolean($template->parentIsSet())->isFalse()->boolean($childTemplate->parentIsSet())->isTrue()->boolean($littleChildTemplate->parentIsSet())->isFalse();
     $childTemplate->addChild($littleChildTemplate);
     $this->assert->boolean($template->parentIsSet())->isFalse()->boolean($childTemplate->parentIsSet())->isTrue()->boolean($littleChildTemplate->parentIsSet())->isTrue();
 }
Exemple #2
0
 public function testUnsetParent()
 {
     $this->if($this->newTestedInstance)->then->boolean($this->testedInstance->parentIsSet())->isFalse()->object($this->testedInstance->unsetParent())->isTestedInstance->boolean($this->testedInstance->parentIsSet())->isFalse()->if($this->testedInstance->addChild($childTemplate = new atoum\template()))->then->boolean($this->testedInstance->parentIsSet())->isFalse()->boolean($childTemplate->parentIsSet())->isTrue()->object($this->testedInstance->unsetParent())->isTestedInstance->object($childTemplate->unsetParent())->isIdenticalTo($childTemplate)->boolean($this->testedInstance->parentIsSet())->isFalse()->boolean($childTemplate->parentIsSet())->isFalse();
 }