/**
  * Ensures that the lazy loader that is returned by init() calls the init()
  * method of the inner resource.
  */
 public function testInitReturnsLazyLoaderThatInitializesTheInnerResource()
 {
     $this->innerResource->expects($this->once())->method('init')->will($this->returnValue(null));
     $loader = $this->decorator->init();
     $this->assertInstanceOf('Mol_Application_Bootstrap_LazyLoader', $loader);
     $loader->load();
 }
Ejemplo n.º 2
0
 /**
  * Register a new resource plugin
  *
  * @param  string|Zend_Application_Resource_Resource $resource
  * @param  mixed  $options
  * @return Zend_Application_Bootstrap_BootstrapAbstract
  * @throws Zend_Application_Bootstrap_Exception When invalid resource is provided
  */
 public function registerPluginResource($resource, $options = null)
 {
     if ($resource instanceof Zend_Application_Resource_Resource) {
         $resource->setBootstrap($this);
         $pluginName = $this->_resolvePluginResourceName($resource);
         $this->_pluginResources[$pluginName] = $resource;
         return $this;
     }
     if (!is_string($resource)) {
         throw new Zend_Application_Bootstrap_Exception('Invalid resource provided to ' . __METHOD__);
     }
     $this->_pluginResources[$resource] = $options;
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * Register a new resource plugin
  * 
  * @param  string|Zend_Application_Resource_Resource $resource
  * @param  mixed  $options
  * @return Zend_Application_Bootstrap_BootstrapAbstract
  * @throws Zend_Application_Bootstrap_Exception When invalid resource is provided
  */
 public function registerPluginResource($resource, $options = null)
 {
     /*
             if (is_string($resource) && class_exists($resource)) {
        $options = (array) $options;
        $options['bootstrap'] = $this;
        $resource = new $resource($options);
             }
     */
     if ($resource instanceof Zend_Application_Resource_Resource) {
         $resource->setBootstrap($this);
         $pluginName = $this->_resolvePluginResourceName($resource);
         $this->_pluginResources[$pluginName] = $resource;
         return $this;
     }
     if (!is_string($resource)) {
         throw new Zend_Application_Bootstrap_Exception('Invalid resource provided to ' . __METHOD__);
     }
     // $resource = strtolower($resource);
     $this->_pluginResources[$resource] = $options;
     return $this;
 }
 /**
  * Returns the options of the inner resource.
  *
  * @return array(string|integer=>mixed)
  */
 public function getOptions()
 {
     return $this->innerResource->getOptions();
 }