public function test_a_string_class_can_be_use_as_extend()
 {
     CacheManager::extend('custom3', StubCacheProvider::class);
     $driver = CacheManager::resolve('custom3');
     $this->assertEquals('stub', $driver);
 }
 /**
  * @return mixed
  */
 public function getCache()
 {
     if (config('doctrine.cache.default')) {
         return CacheManager::resolve(config('doctrine.cache.default'));
     }
 }
 /**
  * Register the meta data drivers
  */
 protected function setupMetaData()
 {
     MetaDataManager::registerDrivers($this->config['meta']['drivers'], $this->config['dev']);
     MetaDataManager::resolved(function (Configuration $configuration) {
         // Debugbar
         if ($this->config['debugbar'] === true) {
             $debugStack = new DebugStack();
             $configuration->setSQLLogger($debugStack);
             $this->app['debugbar']->addCollector(new DoctrineCollector($debugStack));
         }
         $configuration->getMetadataDriverImpl()->addPaths([__DIR__ . '/Migrations', __DIR__ . '/Auth/Passwords']);
         // Automatically make table, column names, etc. like Laravel
         $configuration->setNamingStrategy($this->app->make(LaravelNamingStrategy::class));
         // Custom functions
         $configuration->setCustomDatetimeFunctions($this->config['custom_datetime_functions']);
         $configuration->setCustomNumericFunctions($this->config['custom_numeric_functions']);
         $configuration->setCustomStringFunctions($this->config['custom_string_functions']);
         // Second level caching
         if ($this->config['cache']['second_level']) {
             $configuration->setSecondLevelCacheEnabled(true);
             $cacheConfig = $configuration->getSecondLevelCacheConfiguration();
             $cacheConfig->setCacheFactory(new DefaultCacheFactory($cacheConfig->getRegionsConfiguration(), CacheManager::resolve($this->config['cache']['default'])));
         }
     });
 }