class MockDrupalSystem in X Autoload 7.4
Hierarchy
- class \Drupal\xautoload\DrupalSystem\MockDrupalSystem implements DrupalSystemInterface
Expanded class hierarchy of MockDrupalSystem
1 file declares its use of MockDrupalSystem
- DrupalBootTest.php in tests/
lib/ DrupalBootTest.php
File
- lib/
DrupalSystem/ MockDrupalSystem.php, line 5
Namespace
Drupal\xautoload\DrupalSystemView source
class MockDrupalSystem implements DrupalSystemInterface {
/**
* @var array
*/
protected $variables;
/**
* @var string[]
*/
protected $activeExtensions;
/**
* @param array $variables
* @param string[] $active_extensions
*/
function __construct(array $variables, array $active_extensions) {
$this->variables = $variables;
$this->activeExtensions = $active_extensions;
}
/**
* {@inheritdoc}
*/
function variableGet($name, $default = NULL) {
return $this->variables[$name] ?: $default;
}
/**
* {@inheritdoc}
*/
function drupalGetFilename($type, $name) {
// Simply assume that everything is a module.
return "test://modules/{$name}/{$name}.module";
}
/**
* {@inheritdoc}
*/
function getExtensionTypes($extension_names) {
// Simply assume that everything is a module.
return array_fill_keys($extension_names, 'module');
}
/**
* {@inheritdoc}
*/
function getActiveExtensions() {
return $this->activeExtensions;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MockDrupalSystem:: |
protected | property | ||
MockDrupalSystem:: |
protected | property | ||
MockDrupalSystem:: |
function |
Replacement of drupal_get_filename(), but returning an absolute path. Overrides DrupalSystemInterface:: |
||
MockDrupalSystem:: |
function |
Overrides DrupalSystemInterface:: |
||
MockDrupalSystem:: |
function |
Overrides DrupalSystemInterface:: |
||
MockDrupalSystem:: |
function |
Replacement of variable_get(). Overrides DrupalSystemInterface:: |
||
MockDrupalSystem:: |
function |