protected function execute(InputInterface $input, OutputInterface $output) { $line = $input->getArgument('line'); $file = $this->moodle->directory . '/config.php'; $config = new MoodleConfig(); $contents = $config->read($file); $contents = $config->injectLine($contents, $line); $config->dump($file, $contents); $output->writeln('<info>Updated Moodle config.php file with the following line:</info>'); $output->writeln(['', $line, '']); return $this->lintFile($file, $output); }
/** * @expectedException \RuntimeException */ public function testInjectLineIntoConfigMissingPlaceholder() { $config = new MoodleConfig(); $config->injectLine('Bad param', 'New Line'); }