示例#1
0
 function testIsPluginAvailable()
 {
     //The plugins
     $plugin = new MockPlugin($this);
     //The plugin factory
     $plugin_factory = new MockPluginFactory($this);
     $plugin_factory->setReturnValueAt(0, 'isPluginAvailable', true);
     $plugin_factory->setReturnValueAt(1, 'isPluginAvailable', false);
     //The plugins manager
     $pm = new PluginManager($plugin_factory, mock('EventManager'), mock('SiteCache'), mock('ForgeUpgradeConfig'));
     $this->assertTrue($pm->isPluginAvailable($plugin));
     $this->assertFalse($pm->isPluginAvailable($plugin));
 }
示例#2
0
 function testIsPluginAvailable()
 {
     //The plugins
     $plugin = new MockPlugin($this);
     //The plugin factory
     $plugin_factory = new MockPluginFactory($this);
     $plugin_factory->setReturnValueAt(0, 'isPluginAvailable', true);
     $plugin_factory->setReturnValueAt(1, 'isPluginAvailable', false);
     //The plugins manager
     $pm = new PluginManagerTestVersion($this);
     $pm->setReturnReference('_getPluginFactory', $plugin_factory);
     $this->assertTrue($pm->isPluginAvailable($plugin));
     $this->assertFalse($pm->isPluginAvailable($plugin));
 }