Skip to content

Commit 1dccd62

Browse files
committed
run-tests.php script:fix for options -l and -r failing
the options -l and -r for running single test files was failing with exception `PHP Fatal error: Uncaught ValueError: Path cannot be empty in run-tests.php:3926` for test files that exist.
1 parent 062837a commit 1dccd62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

run-tests.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ function main(): void
434434
break;
435435
case 'r':
436436
case 'l':
437-
$test_list = file($argv[++$i]);
437+
$test_list = [$argv[++$i]];
438438
if ($test_list) {
439439
foreach ($test_list as $test) {
440440
$matches = [];
@@ -445,11 +445,11 @@ function main(): void
445445
}
446446
}
447447
}
448-
if ($switch != 'l') {
448+
if ($switch != 'l' || !isset($argv[$i])) {
449449
break;
450450
}
451-
$i--;
452-
// no break
451+
$failed_tests_file = fopen($argv[$i], 'a+t');
452+
break;
453453
case 'w':
454454
$failed_tests_file = fopen($argv[++$i], 'w+t');
455455
break;

0 commit comments

Comments
 (0)