Exemplo n.º 1
0
 public function testOffsetGet()
 {
     $invoker = new adapter\invoker();
     $this->assert->exception(function () use($invoker) {
         $invoker->offsetGet(-rand(1, PHP_INT_MAX));
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('Call number must be greater than or equal to zero')->variable($invoker->getClosure(rand(0, PHP_INT_MAX)))->isNull();
     $invoker->setClosure($value = function () {
     }, 0);
     $this->assert->object($invoker->offsetGet(0))->isIdenticalTo($invoker)->variable($invoker->getCurrentCall())->isEqualTo(0)->object($invoker->offsetGet($call = rand(1, PHP_INT_MAX)))->isIdenticalTo($invoker)->variable($invoker->getCurrentCall())->isEqualTo($call);
 }