Ejemplo n.º 1
0
 /**
  * @dataProvider getDataToTestStreamOpenFileKey
  */
 public function testStreamOpenFileKey($domain, $uri, $key)
 {
     $stream = $this->getFileStreamMock();
     $stream->expects($this->once())->method('open');
     $filesystem = $this->getFilesystemMock();
     $filesystem->expects($this->once())->method('createFileStream')->with($this->equalTo($key))->will($this->returnValue($stream));
     $this->filesystemMap->set($domain, $filesystem);
     $wrapper = new StreamWrapper();
     $wrapper->stream_open($uri, 'r');
 }
 /**
  * setUp() does not help us because of the process sharing problem.
  * So we use this instead.
  *
  * @throws \Exception
  */
 protected function prepare()
 {
     $this->initOnce();
     $filesystem = StreamWrapper::register('test');
     foreach ($this->exampleModules->discoverModuleFilenames('module') as $name => $filename) {
         $this->exampleDrupal->getSystemTable()->addModuleWithFilename($name, $filename);
     }
     $this->exampleDrupal->getSystemTable()->moduleSetEnabled('system');
     $this->exampleDrupal->initBootstrapStatus();
     # $this->exampleDrupal->getCache()->cacheSet('module_implements', $data, 'cache_bootstrap');
     xautoload()->getServiceContainer()->set('system', $this->exampleDrupal->getMockDrupalSystem());
     $this->callLog = new CallLog();
     StaticCallLog::setCallLog($this->callLog);
 }
 function setUp()
 {
     parent::setUp();
     $this->filesystem = StreamWrapper::register('test');
 }
Ejemplo n.º 4
0
 static function tearDownAfterClass()
 {
     StreamWrapper::unregister();
 }
Ejemplo n.º 5
0
 function tearDown()
 {
     StreamWrapper::unregister();
 }
Ejemplo n.º 6
0
 /**
  * Register the Amazon S3 stream wrapper and associates it with this client object
  *
  * @return $this
  */
 public function registerStreamWrapper()
 {
     StreamWrapper::register($this);
     return $this;
 }