Skip to content
Snippets Groups Projects
Verified Commit 6c4f7615 authored by Alberto Paderno's avatar Alberto Paderno
Browse files

Issue #3464037: Add a property for the modules to enable

parent d7fb7b41
No related branches found
No related tags found
1 merge request!34Issue #3464037: Add a property for the modules to enable
Pipeline #234892 passed
......@@ -10,28 +10,19 @@
*/
class ApcCacheTestCase extends DrupalWebTestCase {
/**
* The modules to enable.
*
* @var array
*/
protected $modules = array('apc');
/**
* {@inheritdoc}
*/
protected function setUp() {
if (extension_loaded('apcu') && apcu_enabled()) {
$args = func_get_args();
$modules = array('apc');
// Allow the child classes to require their own modules.
if (isset($args[0])) {
if (is_array($args[0])) {
$modules = $args[0];
}
elseif (is_string($args[0])) {
$modules = array($args[0]);
}
array_unshift($modules, 'apc');
}
parent::setUp($modules);
parent::setUp($this->modules);
variable_set('cache_flush_cache_apc', 0);
variable_set('cache_class_cache_apc', 'DrupalApcCache');
}
......@@ -41,6 +32,16 @@ class ApcCacheTestCase extends DrupalWebTestCase {
}
}
/**
* Adds modules to the list of modules to enable.
*
* @param array $modules
* The modules to enable.
*/
protected function setModules(...$modules) {
$this->modules = array_unique(array_merge($this->modules, $modules));
}
/**
* Check whether a cache entry exists.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment