Skip to content

Commit

Permalink
Use new config data when Infection has been executed in a first time …
Browse files Browse the repository at this point in the history
…(without .json or json.dist)
  • Loading branch information
sidz committed Nov 20, 2018
1 parent 62b41f8 commit fec5ee8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/Command/BaseCommand.php
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions src/Command/InfectionCommand.php
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/Config/InfectionConfig.php
Expand Up @@ -35,6 +35,7 @@

namespace Infection\Config;

use Infection\TestFramework\TestFrameworkTypes;
use Symfony\Component\Filesystem\Filesystem;

/**
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fec5ee8

Please sign in to comment.