Ejemplo n.º 1
0
 public function offsetSet($call, $mixed)
 {
     if ($this->methodName == 'dir_readdir' && $mixed instanceof \mageekguy\atoum\mock\stream\controller) {
         $mixed = $mixed->getBasename();
     }
     return parent::offsetSet($call, $mixed);
 }
Ejemplo n.º 2
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();
 }