示例#1
0
 public function testCurrent()
 {
     $iterator = new template\iterator();
     $this->assert->boolean($iterator->valid())->isFalse()->variable($iterator->current())->isNull();
     $template = new atoum\template();
     $template->addChild($tag = new template\tag(uniqid()));
     $iterator->addTag($tag->getTag(), $template);
     $this->assert->boolean($iterator->valid())->isTrue()->object($iterator->current())->isIdenticalTo($tag);
     $iterator->next();
     $this->assert->boolean($iterator->valid())->isFalse()->variable($iterator->current())->isNull();
 }
示例#2
0
 public function getByTag($tag)
 {
     $iterator = new template\iterator();
     return $iterator->addTag($tag, $this);
 }