Ejemplo n.º 1
0
 public function testOffsetSet()
 {
     $this->if($invoker = new testedClass(uniqid()))->then->exception(function () use($invoker) {
         $invoker->offsetSet(-rand(1, PHP_INT_MAX), function () {
         });
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('Call number must be greater than or equal to zero')->if($invoker[1] = $value = function () {
     })->then->boolean($invoker->isEmpty())->isFalse()->object($invoker->getClosure(1))->isIdenticalTo($value)->if($invoker[2] = $mixed = uniqid())->then->string($invoker->invoke(array(), 2))->isEqualTo($mixed)->if($invoker[] = $otherMixed = uniqid())->then->string($invoker->invoke(array(), 3))->isEqualTo($otherMixed)->if($invoker[5] = uniqid())->and($invoker[] = $lastMixed = uniqid())->then->boolean(isset($invoker[4]))->isFalse()->boolean(isset($invoker[5]))->isTrue()->boolean(isset($invoker[6]))->isTrue();
 }
Ejemplo n.º 2
0
 public function test__construct()
 {
     $invoker = new adapter\invoker();
     $this->assert->boolean($invoker->isEmpty())->isTrue()->variable($invoker->getCurrentCall())->isNull();
 }