mageekguy\atoum\template::build PHP Method

build() public method

public build ( $mixed = [] )
    public function build($mixed = array())
    {
        foreach ($this->setWith($mixed)->children as $child) {
            $this->addData($child->getData());
        }
        return parent::build();
    }

Usage Example

Esempio n. 1
0
 public function testGetData()
 {
     $template = new atoum\template();
     $this->assert->string($template->getData())->isEmpty();
     $template = new atoum\template($data = uniqid());
     $this->assert->string($template->getData())->isEqualTo($data);
     $template = new atoum\template();
     $template->setData($data = uniqid());
     $this->assert->string($template->getData())->isEqualTo($data);
     $template->addChild(new atoum\template($otherData = uniqid()));
     $this->assert->string($template->getData())->isEqualTo($data);
     $template->build();
     $this->assert->string($template->getData())->isEqualTo($data . $otherData);
 }