Ejemplo n.º 1
0
 /**
  * @covers Robo47_Application_Resource_Cache::init
  * @covers Robo47_Application_Resource_Cache::_setupCache
  */
 public function testSaveToRegistryy()
 {
     $options = array('frontendName' => 'Core', 'backendName' => 'Robo47_Cache_Backend_Array', 'customBackendNaming' => true, 'registryKey' => 'cache_default');
     $resource = new Robo47_Application_Resource_Cache($options);
     $resource->init();
     $this->assertInstanceOf('Zend_Cache_Core', $resource->getCache());
     $this->assertInstanceOf('Robo47_Cache_Backend_Array', $resource->getCache()->getBackend());
     $this->assertTrue(Zend_Registry::isRegistered('cache_default'), 'Key cache_default was not registered in the Registry');
 }
Ejemplo n.º 2
0
 public function init()
 {
     if (!empty($this->_options)) {
         foreach ($this->_options as $name => $options) {
             $resource = new Robo47_Application_Resource_Cache($options);
             $resource->init();
             $this->_caches[$name] = $resource->getCache();
         }
     } else {
         $message = 'Empty options in resource ' . 'Robo47_Application_Resource_CacheMulti.';
         throw new Robo47_Application_Resource_Exception($message);
     }
 }