public function install() { $this->getOutput()->step('Initialize test suite'); $this->execute->mustRunAll(array_merge($this->getBehatInstallProcesses(), $this->getUnitTestInstallProcesses())); $this->getOutput()->step('Building configs'); $this->execute->mustRunAll($this->getPostInstallProcesses()); }
public function install() { $this->getOutput()->step('Install dependencies'); $processes = []; if ($this->plugin->hasUnitTests() || $this->plugin->hasBehatFeatures()) { $processes[] = new Process('composer install --no-interaction --prefer-dist', $this->moodle->directory, null, null, null); } $processes[] = new Process('npm install -g jshint csslint shifter@0.4.6', null, null, null, null); $this->execute->mustRunAll($processes); }
public function install() { $this->getOutput()->step('Cloning Moodle'); $process = new Process(sprintf('git clone --depth=1 --branch %s git://github.com/moodle/moodle %s', $this->branch, $this->moodle->directory)); $process->setTimeout(null); $this->execute->mustRun($process); // Expand the path to Moodle so all other installers use absolute path. $this->moodle->directory = $this->expandPath($this->moodle->directory); $this->getOutput()->step('Moodle assets'); $this->getOutput()->debug('Creating Moodle data directories'); $filesystem = new Filesystem(); $filesystem->mkdir($this->dataDir); $filesystem->mkdir($this->dataDir . '/phpu_moodledata'); $filesystem->mkdir($this->dataDir . '/behat_moodledata'); $this->getOutput()->debug('Create Moodle database'); $this->execute->mustRun($this->database->getCreateDatabaseCommand()); $this->getOutput()->debug('Creating Moodle\'s config file'); $contents = $this->config->createContents($this->database, $this->expandPath($this->dataDir)); $this->config->dump($this->moodle->directory . '/config.php', $contents); $this->addEnv('MOODLE_DIR', $this->moodle->directory); }
public function testPassThrough() { $output = new BufferedOutput(OutputInterface::VERBOSITY_VERY_VERBOSE); $execute = new Execute($output, new ProcessHelper()); $process = $execute->passThrough('php -r "echo 42;"'); $this->assertInstanceOf('Symfony\\Component\\Process\\Process', $process); $this->assertEquals(' RUN php -r "echo 42;"' . PHP_EOL . '42', $output->fetch()); }