diff --git a/src/Config/ValueProvider/TextLogFileProvider.php b/src/Config/ValueProvider/TextLogFileProvider.php index fd3e34a28..007a53849 100644 --- a/src/Config/ValueProvider/TextLogFileProvider.php +++ b/src/Config/ValueProvider/TextLogFileProvider.php @@ -45,8 +45,6 @@ */ final class TextLogFileProvider { - public const TEXT_LOG_FILE_NAME = 'infection.log'; - private ConsoleHelper $consoleHelper; private QuestionHelper $questionHelper; @@ -59,22 +57,32 @@ public function __construct(ConsoleHelper $consoleHelper, QuestionHelper $questi /** * @param string[] $dirsInCurrentDir */ - public function get(IO $io, array $dirsInCurrentDir): string + public function get(IO $io, array $dirsInCurrentDir): ?string { $io->writeln(['']); + $io->writeln([ + '', + 'Infection may save execution results in a text log for a future review.', + 'This can be "infection.log" but we recommend leaving it out for performance reasons.', + 'Press to skip additional logging.', + '', + ]); + $questionText = $this->consoleHelper->getQuestion( 'Where do you want to store the text log file?', - self::TEXT_LOG_FILE_NAME + '' ); - $question = new Question($questionText, self::TEXT_LOG_FILE_NAME); + $question = new Question($questionText, ''); $question->setAutocompleterValues($dirsInCurrentDir); - return $this->questionHelper->ask( + $answer = $this->questionHelper->ask( $io->getInput(), $io->getOutput(), $question ); + + return $answer === '' ? null : $answer; } } diff --git a/tests/e2e/Configure/infection.json.dist b/tests/e2e/Configure/infection.json.dist deleted file mode 100644 index eda367b68..000000000 --- a/tests/e2e/Configure/infection.json.dist +++ /dev/null @@ -1,13 +0,0 @@ -{ - "source": { - "directories": [ - "src" - ] - }, - "logs": { - "text": "infection.log" - }, - "mutators": { - "@default": true - } -} \ No newline at end of file diff --git a/tests/e2e/Configure/infection.json.test b/tests/e2e/Configure/infection.json.test index eda367b68..c3bfc8d7d 100644 --- a/tests/e2e/Configure/infection.json.test +++ b/tests/e2e/Configure/infection.json.test @@ -4,9 +4,6 @@ "src" ] }, - "logs": { - "text": "infection.log" - }, "mutators": { "@default": true } diff --git a/tests/phpunit/Config/ValueProvider/TextLogFileProviderTest.php b/tests/phpunit/Config/ValueProvider/TextLogFileProviderTest.php index c4c27d0e2..d9033b911 100644 --- a/tests/phpunit/Config/ValueProvider/TextLogFileProviderTest.php +++ b/tests/phpunit/Config/ValueProvider/TextLogFileProviderTest.php @@ -67,7 +67,7 @@ public function test_it_uses_default_value(): void [] ); - $this->assertSame(TextLogFileProvider::TEXT_LOG_FILE_NAME, $textLogFilePath); + $this->assertNull($textLogFilePath); } public function test_it_uses_typed_value(): void