Skip to content
Permalink
Browse files

MDL-56347 phpunit: Set class for alternative cache store

If alternative cache store is sued, then set the class
and warn user about this.
  • Loading branch information...
Rajesh Taneja
Rajesh Taneja committed Oct 11, 2016
1 parent 2afadc0 commit ca08b73300842d3128d29d1eb30448c94f6bafe6
Showing with 10 additions and 0 deletions.
  1. +10 −0 cache/tests/fixtures/lib.php
@@ -547,6 +547,8 @@ public static function phpunit_disable() {
*/
public function create_store_from_config($name, array $details, cache_definition $definition) {
static $noticeshown = false;
if (isset($details['use_test_store'])) {
// name, plugin, alt
$class = 'cachestore_'.$details['plugin'];
@@ -558,7 +560,15 @@ public function create_store_from_config($name, array $details, cache_definition
return $instance;
}
}
// Notify user that alternative store is being used, so action can be taken.
if (!$noticeshown) {
echo PHP_EOL . "++ WARNING: " . 'Failed to use "' . $details['plugin'] . '" cache store, alt "' .
$details['alt']['plugin'] . '" cache store is used.' . PHP_EOL . PHP_EOL;
$noticeshown = true;
}
$details = $details['alt'];
$details['class'] = 'cachestore_'.$details['plugin'];
$name = $details['name'];
}

0 comments on commit ca08b73

Please sign in to comment.
You can’t perform that action at this time.