Skip to content

Commit

Permalink
Revert "fix portability issues"
Browse files Browse the repository at this point in the history
This reverts commit 3adb22b.
  • Loading branch information
sebastianbergmann committed Feb 4, 2024
1 parent 573f067 commit 532268a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 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("Specified path: {$path} can't 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("Specified path: {$path} can't be resolved");
}
$logEventsVerboseText = $realPath;

Expand Down
8 changes: 4 additions & 4 deletions tests/end-to-end/cli/log-events-text-invalid-argument.phpt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--TEST--
Test fail with invalid path
phpunit --no-output --log-events-text logfile.txt
--FILE--
<?php declare(strict_types=1);
$traceFile = sys_get_temp_dir() . '/invalid-directory/invalid.file';
$traceFile = 'dasdasdasdasd/dasdasdsa.log';

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
Expand All @@ -19,6 +19,6 @@ print file_get_contents($traceFile);

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

The path /tmp/invalid-directory/invalid.file specified for the --log-events-text option could not be resolved
Specified path: dasdasdasdasd/dasdasdsa.log can't be resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--TEST--
Test fail with invalid path
phpunit --no-output --log-events-verbose-text logfile.txt
--FILE--
<?php declare(strict_types=1);
$traceFile = sys_get_temp_dir() . '/invalid-directory/invalid.file';
$traceFile = 'dasdasdasdasd/dasdasdsa.log';

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
Expand All @@ -14,7 +14,11 @@ $_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.
PHPUnit 10.5.3 by Sebastian Bergmann and contributors.

The path /tmp/invalid-directory/invalid.file specified for the --log-events-verbose-text option could not be resolved
Specified path: dasdasdasdasd/dasdasdsa.log can't be resolved

0 comments on commit 532268a

Please sign in to comment.