Ejemplo n.º 1
0
 /**
  * testCase
  */
 public function testSetCollection()
 {
     $collection = $this->getMock('Enlight_Plugin_PluginCollection');
     $this->bootstrap->setCollection(null);
     $this->assertNull($this->bootstrap->Collection());
     $this->bootstrap->setCollection($collection);
     $this->assertInstanceOf('Enlight_Plugin_PluginCollection', $this->bootstrap->Collection());
 }
Ejemplo n.º 2
0
 /**
  * Registers the given plugin bootstrap. The Enlight_Plugin_PluginCollection instance is
  * set into the plugin by using the Enlight_Plugin_Bootstrap::setCollection() method.
  * The name of the plugin is used as array key.
  *
  * @param Enlight_Plugin_Bootstrap $plugin
  * @return Enlight_Plugin_PluginManager
  */
 public function registerPlugin(Enlight_Plugin_Bootstrap $plugin)
 {
     $plugin->setCollection($this);
     $this->plugins[$plugin->getName()] = $plugin;
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * The Enlight_Plugin_Bootstrap expects a name for the plugin and
  * optionally an instance of the Enlight_Plugin_PluginCollection
  *
  * @param $name
  * @param Enlight_Plugin_PluginCollection $collection
  */
 public function __construct($name, $collection = null)
 {
     $this->setCollection($collection);
     parent::__construct($name);
 }