You are here

static function StreamWrapper::register in X Autoload 7.3

Parameters

string $protocol:

Return value

DummyFilesystem A newly created virtual filesystem.

Throws

\Exception

1 call to StreamWrapper::register()
ClassLoaderTest::setUp in tests/Drupal/xautoload/Tests/ClassLoaderTest.php

File

tests/Drupal/xautoload/Tests/StreamWrapper.php, line 28

Class

StreamWrapper
Intercept calls to the filesystem, so we don't have to create fixture files.

Namespace

Drupal\xautoload\Tests

Code

static function register($protocol) {
  if (!stream_wrapper_register($protocol, 'Drupal\\xautoload\\Tests\\StreamWrapper')) {
    throw new \Exception("Failed to register stream wrapper.");
  }
  self::$filesystem = new DummyFilesystem();
  return self::$filesystem;
}