/**
  * 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 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);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->factory->addInstallers($this->installers);
     $this->install->runInstallation($this->installers);
     $envDumper = new EnvDumper();
     $envDumper->dump($this->installers->mergeEnv(), $this->envFile);
     // Progress bar does not end with a newline.
     $output->writeln('');
 }
Пример #4
0
 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());
 }