Ejemplo n.º 1
0
 public function duplicate()
 {
     $controller = parent::duplicate();
     $controller->adapter =& $this->adapter;
     $controller->exists =& $this->exists;
     $controller->stat =& $this->stat;
     return $controller;
 }
Ejemplo n.º 2
0
 public function testDuplicate()
 {
     $this->if($streamController = new testedClass(uniqid()))->then->object($duplicatedController = $streamController->duplicate())->isCloneOf($streamController)->if($streamController->setPath($path = uniqid()))->then->string($duplicatedController->getPath())->isEqualTo($path)->if($streamController->stream_lock())->then->object($duplicatedController->getCalls())->isEqualTo($streamController->getCalls())->if($streamController->stream_lock = function () {
     })->then->array($duplicatedController->getInvokers())->isEqualTo($streamController->getInvokers());
 }
Ejemplo n.º 3
0
 public function testInvoke()
 {
     $this->if($streamController = new testedClass(uniqid()))->then->variable($streamController->invoke('__construct'))->isNull()->variable($streamController->invoke('dir_closedir'))->isNull()->variable($streamController->invoke('closedir'))->isNull()->variable($streamController->invoke('dir_opendir'))->isNull()->variable($streamController->invoke('opendir'))->isNull()->variable($streamController->invoke('dir_readdir'))->isNull()->variable($streamController->invoke('readdir'))->isNull()->variable($streamController->invoke('dir_rewinddir'))->isNull()->variable($streamController->invoke('rewinddir'))->isNull()->variable($streamController->invoke('mkdir'))->isNull()->variable($streamController->invoke('rename'))->isNull()->variable($streamController->invoke('rmdir'))->isNull()->variable($streamController->invoke('stream_cast'))->isNull()->variable($streamController->invoke('select'))->isNull()->variable($streamController->invoke('stream_close'))->isNull()->variable($streamController->invoke('fclose'))->isNull()->variable($streamController->invoke('stream_eof'))->isNull()->variable($streamController->invoke('feof'))->isNull()->variable($streamController->invoke('stream_flush'))->isNull()->variable($streamController->invoke('fflush'))->isNull()->variable($streamController->invoke('stream_lock'))->isNull()->variable($streamController->invoke('flock'))->isNull()->variable($streamController->invoke('stream_metadata'))->isNull()->variable($streamController->invoke('touch'))->isNull()->variable($streamController->invoke('chown'))->isNull()->variable($streamController->invoke('chmod'))->isNull()->variable($streamController->invoke('chgrp'))->isNull()->variable($streamController->invoke('stream_open'))->isNull()->variable($streamController->invoke('fopen'))->isNull()->variable($streamController->invoke('stream_read'))->isNull()->variable($streamController->invoke('fread'))->isNull()->variable($streamController->invoke('stream_seek'))->isNull()->variable($streamController->invoke('fseek'))->isNull()->variable($streamController->invoke('stream_set_option'))->isNull()->variable($streamController->invoke('stream_stat'))->isNull()->variable($streamController->invoke('fstat'))->isNull()->variable($streamController->invoke('stream_tell'))->isNull()->variable($streamController->invoke('ftell'))->isNull()->variable($streamController->invoke('stream_write'))->isNull()->variable($streamController->invoke('fwrite'))->isNull()->variable($streamController->invoke('unlink'))->isNull()->variable($streamController->invoke('url_stat'))->isNull()->variable($streamController->invoke('stat'))->isNull()->if($method = uniqid())->then->exception(function () use($streamController, $method) {
         $streamController->invoke($method);
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic\\invalidArgument')->hasMessage('Method streamWrapper::' . $method . '() does not exist');
 }