Exemplo n.º 1
0
 public function testOffsetUnset()
 {
     $invoker = new adapter\invoker();
     $this->assert->exception(function () use($invoker) {
         $invoker->offsetUnset(-rand(1, PHP_INT_MAX), function () {
         });
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('Call number must be greater than or equal to zero')->exception(function () use($invoker, &$call) {
         $invoker->offsetUnset($call = rand(0, PHP_INT_MAX), function () {
         });
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('There is no closure defined for call ' . $call);
     $invoker->setClosure(function () {
     });
     $this->assert->boolean($invoker->closureIsSetForCall(0))->isTrue()->object($invoker->offsetUnset(0))->isIdenticalTo($invoker)->boolean($invoker->closureIsSetForCall(0))->isFalse();
 }