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

Issue #3463819: The test classes do not enable the Alternative PHP Cache module

parent d16a7a5a
No related branches found
No related tags found
1 merge request!31Issue #3463819: The test classes do not enable the Alternative PHP Cache module
Pipeline #234034 passed
......@@ -28,6 +28,7 @@ class DrupalApcCache implements DrupalCacheInterface {
* @var array
*/
protected static $operations = array();
/**
* The cache bin.
*
......
......@@ -35,10 +35,36 @@ class ApcCacheTestCase extends DrupalWebTestCase {
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp(func_get_args());
variable_set("cache_flush_{$this->defaultBin}", 0);
variable_set("cache_class_{$this->defaultBin}", 'DrupalApcCache');
if (extension_loaded('apcu') && apcu_enabled()) {
$modules = func_get_args();
// Allow the child classes to require their own modules.
if (isset($modules[0])) {
if (is_array($modules[0])) {
$modules = $modules[0];
array_unshift($modules, 'apc');
}
elseif (is_string($modules[0])) {
$modules = array('apc', $modules[0]);
}
}
else {
$modules = array('apc');
}
parent::setUp($modules);
$this->defaultBin = 'cache_apc';
$this->defaultCid = 'test_temporary';
$this->defaultValue = 'CacheTest';
variable_set("cache_flush_{$this->defaultBin}", 0);
variable_set("cache_class_{$this->defaultBin}", 'DrupalApcCache');
}
else {
// If the APCu extension is not available, disable the tests.
$this->setup = FALSE;
}
}
/**
......
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