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)); }
private function useFulltextSearch() { $fulltext_plugin = $this->plugin_manager->getPluginByName('fulltextsearch'); if (!$fulltext_plugin) { return false; } return $this->plugin_manager->isPluginAvailable($fulltext_plugin); }