You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: co-phpunit
+20-17Lines changed: 20 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -45,26 +45,29 @@ if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
45
45
fwrite(STDERR, 'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL . ' composer install' . PHP_EOL . PHP_EOL . 'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL);
46
46
die(1);
47
47
}
48
-
if (!isset(getopt('', ['prepend:'])['prepend'])) {
49
-
(function () {
50
-
$prepend = null;
51
-
foreach ($_SERVER['argv'] as$index => $argv) {
52
-
// --prepend /path/to/file
53
-
if ($argv === '--prepend') {
54
-
$prepend = $_SERVER['argv'][$index + 1] ?? null;
55
-
break;
56
-
}
57
-
// --prepend=/path/to/file
58
-
if (strpos($argv, '--prepend=') === 0) {
59
-
$prepend = substr($argv, 10);
60
-
break;
48
+
(function () {
49
+
$prepend = null;
50
+
foreach ($_SERVER["argv"] as$index => $argv) {
51
+
// --prepend /path/to/file
52
+
if ($argv === "--prepend") {
53
+
unset($_SERVER["argv"][$index]);
54
+
if (isset($_SERVER["argv"][$index + 1])) {
55
+
$prepend = $_SERVER["argv"][$index + 1];
56
+
unset($_SERVER["argv"][$index + 1]);
61
57
}
58
+
break;
62
59
}
63
-
if ($prepend !== null && file_exists($prepend)) {
64
-
require$prepend;
60
+
// --prepend=/path/to/file
61
+
if (strpos($argv, "--prepend=") === 0) {
62
+
$prepend = substr($argv, 10);
63
+
unset($_SERVER["argv"][$index]);
64
+
break;
65
65
}
66
-
})();
67
-
}
66
+
}
67
+
if ($prepend !== null && file_exists($prepend)) {
68
+
require$prepend;
69
+
}
70
+
})();
68
71
requirePHPUNIT_COMPOSER_INSTALL;
69
72
$code = 0;
70
73
Swoole\Coroutine::set(['hook_flags' => SWOOLE_HOOK_ALL, 'exit_condition' => function () {
0 commit comments