function testEnablePlugin() { //The plugins $plugin = new MockPlugin($this); $plugin->setReturnValue('canBeMadeAvailable', true); //The plugin factory $plugin_factory = new MockPluginFactory($this); $plugin_factory->expectOnce('availablePlugin'); $site_cache = mock('SiteCache'); expect($site_cache)->invalidatePluginBasedCaches()->once(); //The plugins manager $pm = new PluginManager($plugin_factory, mock('EventManager'), $site_cache, mock('ForgeUpgradeConfig')); $pm->availablePlugin($plugin); }