Ejemplo n.º 1
0
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  * @return int|null
  * @throws \Symfony\Component\Console\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Console\Exception\RuntimeException
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     /** @var PathHelper $pathHelper */
     $pathHelper = $this->getHelper('path');
     $configPath = $pathHelper->getPath('.travis.yml');
     if (file_exists($configPath)) {
         $shouldOverwrite = $this->questionHelper->confirmOverwriteFile($input, $output, $configPath);
         if (!$shouldOverwrite) {
             return 0;
         }
     }
     $config = $this->configBuilder->createConfig($input, $output);
     $this->configWriter->toYmlFile($config, $configPath);
     return 0;
 }
Ejemplo n.º 2
0
 public function test_write_file_with_language()
 {
     $config = new Config('php');
     $bytesWritten = $this->sut->toYmlFile($config, $this->configFile);
     self::assertGreaterThan(0, $bytesWritten);
     $actual = Yaml::parse(file_get_contents($this->configFile));
     self::assertArrayKeyHasValue($actual, 'language', 'php');
 }