class FakeAutoloader in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/DrupalKernel/DrupalKernelTest.php \Drupal\Tests\Core\DrupalKernel\FakeAutoloader
A fake autoloader for testing
Hierarchy
- class \Drupal\Tests\Core\DrupalKernel\FakeAutoloader
Expanded class hierarchy of FakeAutoloader
File
- core/
tests/ Drupal/ Tests/ Core/ DrupalKernel/ DrupalKernelTest.php, line 202
Namespace
Drupal\Tests\Core\DrupalKernelView source
class FakeAutoloader {
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend
* Whether to prepend the autoloader or not
*/
public function register($prepend = FALSE) {
spl_autoload_register([
$this,
'loadClass',
], TRUE, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister() {
spl_autoload_unregister([
$this,
'loadClass',
]);
}
/**
* Loads the given class or interface.
*
* @return null
* This class never loads.
*/
public function loadClass() {
return NULL;
}
/**
* Finds a file by class name while caching lookups to APC.
*
* @return null
* This class never finds.
*/
public function findFile() {
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FakeAutoloader:: |
public | function | Finds a file by class name while caching lookups to APC. | |
FakeAutoloader:: |
public | function | Loads the given class or interface. | |
FakeAutoloader:: |
public | function | Registers this instance as an autoloader. | |
FakeAutoloader:: |
public | function | Unregisters this instance as an autoloader. |