Inheritance: extends mageekguy\atoum\php\tokenizer\iterator
Exemplo n.º 1
0
 public function testGetName()
 {
     $iterator = new iterators\phpFunction();
     $this->assert->variable($iterator->getName())->isNull();
     $iterator->append(new tokenizer\token(T_FUNCTION));
     $this->assert->variable($iterator->getName())->isNull();
     $iterator->append(new tokenizer\token(T_WHITESPACE));
     $this->assert->variable($iterator->getName())->isNull();
     $iterator->append(new tokenizer\token(T_STRING, $name = uniqid()));
     $this->assert->string($iterator->getName())->isEqualTo($name);
     $iterator->append(new tokenizer\token(T_FUNCTION));
     $iterator->append(new tokenizer\token(T_STRING, uniqid()));
     $this->assert->string($iterator->getName())->isEqualTo($name);
 }
Exemplo n.º 2
0
 public function testAppendFunction()
 {
     $iterator = new iterators\phpScript();
     $functionIterator = new iterators\phpFunction();
     $functionIterator->append($token1 = new tokenizer\token(uniqid()))->append($token2 = new tokenizer\token(uniqid()));
     $this->assert->object($iterator->appendFunction($functionIterator))->isIdenticalTo($iterator)->array($iterator->getFunctions())->isEqualTo(array($functionIterator))->castToString($iterator)->isEqualTo($token1 . $token2);
 }
Exemplo n.º 3
0
 public function testAppendFunction()
 {
     $this->if($this->newTestedInstance, $functionIterator = new iterators\phpFunction(), $functionIterator->append($token1 = new tokenizer\token(uniqid()))->append($token2 = new tokenizer\token(uniqid())))->then->object($this->testedInstance->appendFunction($functionIterator))->isTestedInstance->array($this->testedInstance->getFunctions())->isEqualTo(array($functionIterator))->castToString($this->testedInstance)->isEqualTo($token1 . $token2);
 }