public function testTotalSteps() { $installer = new DummyInstaller(); $installers = new InstallerCollection(new InstallOutput()); $installers->add($installer); $installers->add(new DummyInstaller()); $installers->add(new DummyInstaller()); $this->assertEquals($installers->sumStepCount(), $installer->stepCount() * 3); }
/** * Given a big bag of install options, add installers to the collection. * * @param InstallerCollection $installers Installers will be added to this */ public function addInstallers(InstallerCollection $installers) { $installers->add(new MoodleInstaller($this->execute, $this->database, $this->moodle, new MoodleConfig(), $this->branch, $this->dataDir)); $installers->add(new PluginInstaller($this->moodle, $this->plugin, $this->pluginsDir, $this->dumper)); $installers->add(new VendorInstaller($this->moodle, $this->plugin, $this->execute)); if ($this->plugin->hasBehatFeatures() || $this->plugin->hasUnitTests()) { $installers->add(new TestSuiteInstaller($this->moodle, $this->plugin, $this->execute)); } }
public function testRunInstallation() { $output = new InstallOutput(); $installer = new DummyInstaller(); $installers = new InstallerCollection($output); $installers->add($installer); $manager = new Install($output); $manager->runInstallation($installers, new EnvDumper()); $this->assertEquals($installer->stepCount(), $output->getStepCount()); }