From 384c2a9567556f41b91db96e672470dff4b76086 Mon Sep 17 00:00:00 2001 From: Oleg Zhulnev Date: Tue, 20 Nov 2018 23:03:59 +0300 Subject: [PATCH] Use a new config data in the first execution --- src/Command/BaseCommand.php | 2 -- src/Command/InfectionCommand.php | 3 +-- src/Config/InfectionConfig.php | 3 ++- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Command/BaseCommand.php b/src/Command/BaseCommand.php index e5020b5bf0..bbeb217229 100644 --- a/src/Command/BaseCommand.php +++ b/src/Command/BaseCommand.php @@ -74,8 +74,6 @@ public function getContainer(): Container protected function initialize(InputInterface $input, OutputInterface $output): void { - parent::initialize($input, $output); - $this->input = $input; $this->output = $output; } diff --git a/src/Command/InfectionCommand.php b/src/Command/InfectionCommand.php index eac0d67dee..4cc70984d8 100644 --- a/src/Command/InfectionCommand.php +++ b/src/Command/InfectionCommand.php @@ -352,10 +352,9 @@ private function runConfigurationCommand(Locator $locator): void $locator->locateOneOf(InfectionConfig::POSSIBLE_CONFIG_FILE_NAMES); } catch (\Exception $e) { $configureCommand = $this->getApplication()->find('configure'); - $config = $this->getContainer()->get('infection.config'); $args = [ - '--test-framework' => $this->input->getOption('test-framework') ?: $config->getTestFramework(), + '--test-framework' => $this->input->getOption('test-framework') ?: TestFrameworkTypes::PHPUNIT, ]; $newInput = new ArrayInput($args); diff --git a/src/Config/InfectionConfig.php b/src/Config/InfectionConfig.php index cb4daaede1..a2198b140b 100644 --- a/src/Config/InfectionConfig.php +++ b/src/Config/InfectionConfig.php @@ -35,6 +35,7 @@ namespace Infection\Config; +use _HumbugBox40a58e7ed96f\Infection\TestFramework\TestFrameworkTypes; use Symfony\Component\Filesystem\Filesystem; /** @@ -152,7 +153,7 @@ public function getBootstrap(): string public function getTestFramework(): string { - return $this->config->testFramework ?? 'phpunit'; + return $this->config->testFramework ?? TestFrameworkTypes::PHPUNIT; } public function getInitialTestsPhpOptions(): string