/** * Constructor * * Invoke setContainerFactory, set _coantainerFactory if factory is configurated * Ensure FrontController resource is registered * * @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application * @return void */ public function __construct($application) { $this->setContainerFactory($application->getOptions()); parent::__construct($application); if (!$this->hasPluginResource('FrontController')) { $this->registerPluginResource('FrontController'); } }
public function testTranslatorUseGivenKeyInCacheManager() { $cacheKey = 'myKey'; $options = array('cacheKey' => $cacheKey, 'cacheEnabled' => true); $cacheOptions = array('resources' => array('cachemanager' => array($cacheKey => array('frontend' => array('name' => 'Core', 'options' => array('lifetime' => 7200, 'automatic_serialization' => true)), 'backend' => array('name' => 'File', 'options' => array('cache_dir' => '/tmp/')))))); $this->bootstrap->setOptions($cacheOptions); $resource = new Zle_Application_Resource_Translate(); $resource->setBootstrap($this->bootstrap); $resource->setOptions(array_merge($this->resourceOptions, $options)); $translate = $resource->init(); $cache = $this->bootstrap->getResource('cachemanager')->getCache($cacheKey); $this->assertEquals($cache, $translate->getCache()); }