Пример #1
0
 public function testAppendMethod()
 {
     $iterator = new iterators\phpClass();
     $methodIterator = new iterators\phpMethod();
     $methodIterator->append($token1 = new tokenizer\token(uniqid()))->append($token2 = new tokenizer\token(uniqid()));
     $this->assert->object($iterator->appendMethod($methodIterator))->isIdenticalTo($iterator)->array($iterator->getMethods())->isEqualTo(array($methodIterator))->castToString($iterator)->isEqualTo($token1 . $token2);
 }
Пример #2
0
 public function testAppendMethod()
 {
     $this->if($this->newTestedInstance, $methodIterator = new iterators\phpMethod(), $methodIterator->append($token1 = new tokenizer\token(uniqid()))->append($token2 = new tokenizer\token(uniqid())))->then->object($this->testedInstance->appendMethod($methodIterator))->isTestedInstance->array($this->testedInstance->getMethods())->isEqualTo(array($methodIterator))->castToString($this->testedInstance)->isEqualTo($token1 . $token2);
 }