public function itReturnsEmptyArrayWhenDependenciesAreMet() { $installed_plugin = array($this->tracker_plugin, $this->fusionforge_compat_plugin); stub($this->plugin_manager)->getPluginByName('tracker')->returns($this->tracker_plugin); stub($this->plugin_manager)->getPluginByName('fusionforge_compat')->returns($this->fusionforge_compat_plugin); stub($this->plugin_manager)->getAllPlugins()->returns($installed_plugin); $solver = new PluginDependencySolver($this->plugin_manager); $this->assertEqual($solver->getUnmetInstalledDependencies('mediawiki'), array()); }
function confirmInstall() { $name = HTTPRequest::instance()->get('name'); if ($this->isPluginAlreadyInstalled($name)) { $this->browse(); return; } $dependencies = $this->dependency_solver->getUnmetInstalledDependencies($name); if ($dependencies) { $error_msg = $GLOBALS['Language']->getText('plugin_pluginsadministration', 'error_install_dependency'); $this->displayDependencyError($dependencies, $error_msg); $this->displayInstallReadme($name); return; } echo '<p>You\'re about to install ' . $name . '.</p>'; $this->displayInstallReadme($name); $this->displayConfirmationInstallForm($name); }