Exemplo n.º 1
0
 public function testAtCall()
 {
     $invoker = new adapter\invoker();
     $defaultReturn = uniqid();
     $invoker->setClosure(function () use($defaultReturn) {
         return $defaultReturn;
     }, 0);
     $this->assert->variable($invoker->getCurrentCall())->isNull()->object($invoker->atCall($call = rand(1, PHP_INT_MAX)))->isIdenticalTo($invoker)->integer($invoker->getCurrentCall())->isEqualTo($call);
 }
Exemplo n.º 2
0
 public function testAtCall()
 {
     $this->if($invoker = new testedClass(uniqid()))->and($invoker->setClosure(function () use(&$defaultReturn) {
         return $defaultReturn = uniqid();
     }, 0))->then->variable($invoker->getCurrentCall())->isNull()->object($invoker->atCall($call = rand(1, PHP_INT_MAX)))->isIdenticalTo($invoker)->integer($invoker->getCurrentCall())->isEqualTo($call);
 }