public function testSetParent() { $token = new tokenizer\token(uniqid(), uniqid(), rand(1, PHP_INT_MAX)); $this->assert->variable($token->getParent())->isNull()->object($token->setParent($parent = new tokenizer\iterator()))->isIdenticalTo($token)->object($token->getParent())->isIdenticalTo($parent)->sizeOf($parent)->isEqualTo(1)->object($parent->current())->isIdenticalTo($token)->exception(function () use($token) { $token->setParent(new tokenizer\iterator()); })->isInstanceOf('mageekguy\\atoum\\exceptions\\runtime')->hasMessage('Parent is already set'); }
public function reset() { $this->methods = array(); $this->constants = array(); $this->properties = array(); return parent::reset(); }
public function reset() { $this->functions = array(); $this->constants = array(); $this->classes = array(); return parent::reset(); }
public function reset() { $this->arguments = array(); return parent::reset(); }
public function testFindTag() { $iterator = new tokenizer\iterator(); $this->assert->variable($iterator->key())->isNull()->variable($iterator->findTag(uniqid()))->isNull()->variable($iterator->key())->isNull(); $iterator->append(new tokenizer\token($token = uniqid())); $this->assert->integer($iterator->key())->isZero()->variable($iterator->findTag(uniqid()))->isNull()->variable($iterator->key())->isNull()->integer($iterator->findTag($token))->isZero()->integer($iterator->key())->isZero(); }
public function testGetRoot() { $this->if($this->newTestedInstance)->then->variable($this->testedInstance->getRoot())->isNull()->if($parentIterator = new tokenizer\iterator(), $parentIterator->append($this->testedInstance))->then->object($this->testedInstance->getRoot())->isIdenticalTo($parentIterator)->if($grandFatherIterator = new tokenizer\iterator(), $grandFatherIterator->append($parentIterator))->then->object($this->testedInstance->getRoot())->isIdenticalTo($grandFatherIterator)->object($parentIterator->getRoot())->isIdenticalTo($grandFatherIterator); }