Exemplo n.º 1
0
Arquivo: lib.php Projeto: dg711/moodle
 /**
  * Generates an instance of the cache store that can be used for testing.
  *
  * @param cache_definition $definition
  * @return cachestore_apcu|false
  */
 public static function initialise_unit_test_instance(cache_definition $definition)
 {
     if (!self::are_requirements_met()) {
         return false;
     }
     $store = new cachestore_apcu('Test APCu', array('prefix' => 'phpunit'));
     if (!$store->is_ready()) {
         return false;
     }
     $store->initialise($definition);
     return $store;
 }
Exemplo n.º 2
0
 /**
  * Generates an instance of the cache store that can be used for testing.
  *
  * @param cache_definition $definition
  * @return cachestore_apcu|false
  */
 public static function initialise_unit_test_instance(cache_definition $definition)
 {
     if (!self::are_requirements_met()) {
         return false;
     }
     if (!defined('TEST_CACHESTORE_APCU')) {
         return false;
     }
     $store = new cachestore_apcu('Test APCu', array());
     if (!$store->is_ready()) {
         return false;
     }
     $store->initialise($definition);
     return $store;
 }