public function test_behat_command_added_to_config_if_phpunit_is_installed() { $this->packageHelper->method('hasPackage')->willReturnMap([['behat/behat', null, $this->input, $this->output, true]]); $this->questionHelper->method('confirmRunBehat')->willReturn(true); $actual = $this->sut->createConfig($this->input, $this->output); self::assertContains('vendor/bin/behat', $actual->getScript()); }
/** * @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; }