mageekguy\atoum\template::deleteChild PHP Method

deleteChild() public method

public deleteChild ( mageekguy\atoum\template\data $child )
$child mageekguy\atoum\template\data
    public function deleteChild(template\data $child)
    {
        if ($this->isChild($child) === true) {
            unset($this->children[$child->rank]);
            $child->parent = null;
            $child->rank = null;
        }
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 public function testHasChildren()
 {
     $template = new atoum\template();
     $this->assert->boolean($template->hasChildren())->isFalse();
     $template->addChild($childTemplate = new atoum\template());
     $this->assert->boolean($template->hasChildren())->isTrue();
     $template->deleteChild($childTemplate);
     $this->assert->boolean($template->hasChildren())->isFalse();
 }