function FakeAutoloader::register

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php \Drupal\Tests\Core\DrupalKernel\FakeAutoloader::register()
  2. 8.9.x core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php \Drupal\Tests\Core\DrupalKernel\FakeAutoloader::register()
  3. 11.x core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php \Drupal\Tests\Core\DrupalKernel\FakeAutoloader::register()

Registers this instance as an autoloader.

Parameters

bool $prepend: Whether to prepend the autoloader or not

File

core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php, line 180

Class

FakeAutoloader
A fake autoloader for testing.

Namespace

Drupal\Tests\Core\DrupalKernel

Code

public function register($prepend = FALSE) {
    spl_autoload_register([
        $this,
        'loadClass',
    ], TRUE, $prepend);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.