setPluginHandler() public method

Sets the current plugin handler.
public setPluginHandler ( Phergie_Plugin_Handler $handler ) : Phergie_Plugin_Abstract
$handler Phergie_Plugin_Handler Plugin handler
return Phergie_Plugin_Abstract Provides a fluent interface
Ejemplo n.º 1
0
 /**
  * Initializes instance properties.
  *
  * @return void
  */
 public function setUp()
 {
     if (empty($this->pluginClass)) {
         $this->pluginClass = preg_replace('/Test$/', '', get_class($this));
     }
     if (empty($this->plugin)) {
         $this->plugin = new $this->pluginClass();
     }
     $this->plugin->setConfig($this->getMockConfig());
     $this->plugin->setConnection($this->getMockConnection());
     $this->plugin->setEventHandler($this->getMockEventHandler());
     $this->plugin->setPluginHandler($this->getMockPluginHandler());
 }
Ejemplo n.º 2
0
 /**
  * Initializes instance properties.
  *
  * @return void
  */
 public function setUp()
 {
     if (empty($this->pluginClass)) {
         $this->pluginClass = preg_replace('/Test$/', '', get_class($this));
     }
     if (empty($this->plugin)) {
         $this->plugin = new $this->pluginClass();
     }
     $this->plugin->setConfig($this->getMockConfig());
     $this->plugin->setConnection($this->getMockConnection());
     $this->plugin->setEventHandler($this->getMockEventHandler());
     $plugins = $this->getMockPluginHandler();
     $plugins->expects($this->any())->method('getPlugin')->will($this->returnCallback(array($this, 'requirePlugin')));
     $plugins->expects($this->any())->method('removePlugin')->will($this->returnCallback(array($this, 'removePlugin')));
     $this->plugin->setPluginHandler($plugins);
     $this->mockPlugins = array();
     $this->expectedRequiredPlugins = array();
     $this->actualRequiredPlugins = array();
     $this->expectedRemovedPlugins = array();
     $this->actualRemovedPlugins = array();
 }