You are here

public static function vfsStreamWrapper::register in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php \org\bovigo\vfs\vfsStreamWrapper::register()

method to register the stream wrapper

Please be aware that a call to this method will reset the root element to null. If the stream is already registered the method returns silently. If there is already another stream wrapper registered for the scheme used by vfsStream a vfsStreamException will be thrown.

Throws

vfsStreamException

29 calls to vfsStreamWrapper::register()
PermissionHandlerTest::testBuildPermissionsSortPerModule in core/modules/user/tests/src/Unit/PermissionHandlerTest.php
Tests permissions sort inside a module.
PermissionHandlerTest::testBuildPermissionsYaml in core/modules/user/tests/src/Unit/PermissionHandlerTest.php
Tests permissions provided by YML files.
PermissionHandlerTest::testBuildPermissionsYamlCallback in core/modules/user/tests/src/Unit/PermissionHandlerTest.php
Tests dynamic callback permissions provided by YML files.
PermissionHandlerTest::testPermissionsYamlStaticAndCallback in core/modules/user/tests/src/Unit/PermissionHandlerTest.php
Tests a YAML file containing both static permissions and a callback.
vfsStream::setup in vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStream.php
helper method for setting up vfsStream in unit tests

... See full list

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php, line 103

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

public static function register() {
  self::$root = null;
  self::$quota = Quota::unlimited();
  if (true === self::$registered) {
    return;
  }
  if (@stream_wrapper_register(vfsStream::SCHEME, __CLASS__) === false) {
    throw new vfsStreamException('A handler has already been registered for the ' . vfsStream::SCHEME . ' protocol.');
  }
  self::$registered = true;
}