public function testGetPlugins() { $broker = new Zend_Controller_Plugin_Broker(); $plugin = new Zend_Controller_Plugin_BrokerTest_TestPlugin(); $broker->registerPlugin($plugin); $plugins = $broker->getPlugins(); $this->assertEquals(1, count($plugins)); $this->assertSame($plugin, $plugins[0]); }
/** * Retrieve all plugins * * @return array */ public function getPlugins() { return $this->_plugins->getPlugins(); }
public function testRegisterPluginStackOrderWithAutmaticNumbersIncrementsCorrectly() { $broker = new Zend_Controller_Plugin_Broker(); $plugin1 = new Zend_Controller_Plugin_BrokerTest_TestPlugin(); $plugin2 = new Zend_Controller_Plugin_BrokerTest_ExceptionTestPlugin(); $plugin3 = new Zend_Controller_Plugin_BrokerTest_TestPlugin2(); $broker->registerPlugin($plugin1, 2); $broker->registerPlugin($plugin2, 3); $broker->registerPlugin($plugin3); $plugins = $broker->getPlugins(); $expected = array(2 => $plugin1, 3 => $plugin2, 4 => $plugin3); $this->assertSame($expected, $plugins); }