Skip to content

Commit

Permalink
improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
marac19901990 committed Dec 31, 2023
1 parent 36ffa74 commit d1e4a51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 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 @@ -808,7 +808,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 @@ -819,7 +819,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: 2 additions & 7 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 fail with invalid path
Test fails with invalid path
--FILE--
<?php declare(strict_types=1);
$traceFile = sys_get_temp_dir() . '/invalid-directory/invalid.file';
Expand All @@ -9,16 +9,11 @@ $_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 fail with invalid path
Test fails with invalid path
--FILE--
<?php declare(strict_types=1);
$traceFile = sys_get_temp_dir() . '/invalid-directory/invalid.file';
Expand All @@ -9,12 +9,11 @@ $_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 d1e4a51

Please sign in to comment.