Skip to content

Commit

Permalink
Revert "improve formatting"
Browse files Browse the repository at this point in the history
This reverts commit b0479f2.
  • Loading branch information
sebastianbergmann committed Feb 4, 2024
1 parent c9c0119 commit 573f067
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/TextUI/Configuration/Cli/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ public function fromParameters(array $parameters): Configuration
$realPath = realpath($path);

if (!$realPath) {
throw new Exception("The path \"{$path}\" specified for the --log-events-text option could not be resolved");
throw new Exception("The path {$path} specified for the --log-events-text option could not be resolved");
}
$logEventsText = $realPath;

Expand All @@ -821,7 +821,7 @@ public function fromParameters(array $parameters): Configuration
$realPath = realpath($path);

if (!$realPath) {
throw new Exception("The path \"{$path}\" specified for the --log-events-verbose-text option could not be resolved");
throw new Exception("The path {$path} specified for the --log-events-verbose-text option could not be resolved");
}
$logEventsVerboseText = $realPath;

Expand Down
9 changes: 7 additions & 2 deletions tests/end-to-end/cli/log-events-text-invalid-argument.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Test fails with invalid path
Test fail with invalid path
--FILE--
<?php declare(strict_types=1);
$traceFile = sys_get_temp_dir() . '/invalid-directory/invalid.file';
Expand All @@ -9,11 +9,16 @@ $_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = __DIR__ . '/../_files/log-events-text';

require __DIR__ . '/../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);

print file_get_contents($traceFile);

unlink($traceFile);
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

The path "/tmp/invalid-directory/invalid.file" specified for the --log-events-text option could not be resolved
The path /tmp/invalid-directory/invalid.file specified for the --log-events-text option could not be resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Test fails with invalid path
Test fail with invalid path
--FILE--
<?php declare(strict_types=1);
$traceFile = sys_get_temp_dir() . '/invalid-directory/invalid.file';
Expand All @@ -9,11 +9,12 @@ $_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--no-output';
$_SERVER['argv'][] = '--log-events-verbose-text';
$_SERVER['argv'][] = $traceFile;
$_SERVER['argv'][] = __DIR__ . '/../_files/log-events-text';

require __DIR__ . '/../../bootstrap.php';

(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

The path "/tmp/invalid-directory/invalid.file" specified for the --log-events-verbose-text option could not be resolved
The path /tmp/invalid-directory/invalid.file specified for the --log-events-verbose-text option could not be resolved

0 comments on commit 573f067

Please sign in to comment.