You are here

public function FakeAutoloader::register in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php \Drupal\Tests\Core\DrupalKernel\FakeAutoloader::register()
  2. 9 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 152

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);
}