public function itReturnsTheInstalledDependencies()
 {
     $installed_plugin = array($this->mediawiki_plugin, $this->tracker_plugin, $this->fusionforge_compat_plugin);
     stub($this->plugin_manager)->getAllPlugins()->returns($installed_plugin);
     $solver = new PluginDependencySolver($this->plugin_manager);
     $this->assertEqual($solver->getInstalledDependencies($this->fusionforge_compat_plugin), array('mediawiki'));
 }
 function confirmUninstall()
 {
     $request =& HTTPRequest::instance();
     if (!$request->exist('plugin_id')) {
         $this->browse();
         return;
     }
     $plugin_manager = $this->plugin_manager;
     $plugin = $plugin_manager->getPluginById((int) $request->get('plugin_id'));
     if (!$plugin) {
         $this->browse();
         return;
     }
     $dependencies = $this->dependency_solver->getInstalledDependencies($plugin);
     if ($dependencies) {
         $error_msg = $GLOBALS['Language']->getText('plugin_pluginsadministration', 'error_uninstall_dependency', $plugin->getName());
         $this->displayDependencyError($dependencies, $error_msg);
         return;
     }
     $this->displayUninstallationConfirmScreen($plugin);
 }