diff --git a/src/Options.php b/src/Options.php index af7b0158..e062cf5b 100644 --- a/src/Options.php +++ b/src/Options.php @@ -68,7 +68,7 @@ public function shouldWriteFile(string $file, bool $overwrite): bool exec('git status --short --ignored --untracked-files=all -- '.ProcessExecutor::escape($file).' 2>&1', $output, $status); if (0 !== $status) { - return $this->io && $this->io->askConfirmation(\sprintf('Cannot determine the state of the "%s" file, overwrite anyway? [y/N] ', $file), false); + return $this->io && $this->io->askConfirmation(\sprintf('Cannot determine the state of the "%s" file, overwrite anyway? [Y/n] ', $file)); } if (empty($output[0]) || preg_match('/^[ AMDRCU][ D][ \t]/', $output[0])) { @@ -78,7 +78,7 @@ public function shouldWriteFile(string $file, bool $overwrite): bool $name = basename($file); $name = \strlen($output[0]) - \strlen($name) === strrpos($output[0], $name) ? substr($output[0], 3) : $name; - return $this->io && $this->io->askConfirmation(\sprintf('File "%s" has uncommitted changes, overwrite? [y/N] ', $name), false); + return $this->io && $this->io->askConfirmation(\sprintf('File "%s" has uncommitted changes, overwrite? [Y/n] ', $name)); } public function toArray(): array diff --git a/tests/Configurator/CopyFromPackageConfiguratorTest.php b/tests/Configurator/CopyFromPackageConfiguratorTest.php index 8a5366b3..87ebee02 100644 --- a/tests/Configurator/CopyFromPackageConfiguratorTest.php +++ b/tests/Configurator/CopyFromPackageConfiguratorTest.php @@ -57,7 +57,7 @@ public function testConfigureAndOverwriteFiles() $this->io->expects($this->at(0))->method('writeError')->with([' Copying files from package']); $this->io->expects($this->at(2))->method('writeError')->with([' Created "./public/file"']); - $this->io->method('askConfirmation')->with('File "build/public/file" has uncommitted changes, overwrite? [y/N] ')->willReturn(true); + $this->io->method('askConfirmation')->with('File "build/public/file" has uncommitted changes, overwrite? [Y/n] ')->willReturn(true); $this->assertFileExists($this->targetFile); $this->createConfigurator()->configure( diff --git a/tests/Configurator/CopyFromRecipeConfiguratorTest.php b/tests/Configurator/CopyFromRecipeConfiguratorTest.php index b0e94361..2e83b381 100644 --- a/tests/Configurator/CopyFromRecipeConfiguratorTest.php +++ b/tests/Configurator/CopyFromRecipeConfiguratorTest.php @@ -68,7 +68,7 @@ public function testConfigureAndOverwriteFiles() $this->io->expects($this->at(0))->method('writeError')->with([' Copying files from recipe']); $this->io->expects($this->at(2))->method('writeError')->with([' Created "./config/file"']); - $this->io->method('askConfirmation')->with('File "build/config/file" has uncommitted changes, overwrite? [y/N] ')->willReturn(true); + $this->io->method('askConfirmation')->with('File "build/config/file" has uncommitted changes, overwrite? [Y/n] ')->willReturn(true); $this->assertFileExists($this->targetFile); $this->createConfigurator()->configure( diff --git a/tests/FlexTest.php b/tests/FlexTest.php index f4a315ba..b000c445 100644 --- a/tests/FlexTest.php +++ b/tests/FlexTest.php @@ -322,7 +322,7 @@ public function testInstallWithPackageJsonToSynchronizeSkipped() $this->assertStringContainsString( 'Skip synchronizing package.json with PHP packages', - $io->getOutput(), + $io->getOutput() ); } @@ -339,7 +339,7 @@ public function testInstallWithoutPackageJsonToSynchronizeSkipped(array $extra) $this->assertStringNotContainsString( 'Skip synchronizing package.json with PHP packages', - $io->getOutput(), + $io->getOutput() ); }