MockDrupalSystem.php in X Autoload 7.4
File
lib/DrupalSystem/MockDrupalSystem.php
View source
<?php
namespace Drupal\xautoload\DrupalSystem;
class MockDrupalSystem implements DrupalSystemInterface {
protected $variables;
protected $activeExtensions;
function __construct(array $variables, array $active_extensions) {
$this->variables = $variables;
$this->activeExtensions = $active_extensions;
}
function variableGet($name, $default = NULL) {
return $this->variables[$name] ?: $default;
}
function drupalGetFilename($type, $name) {
return "test://modules/{$name}/{$name}.module";
}
function getExtensionTypes($extension_names) {
return array_fill_keys($extension_names, 'module');
}
function getActiveExtensions() {
return $this->activeExtensions;
}
}