私はsymfonyのコードベースKernelTestCase::getPhpUnitCliConfigArgument
/**
* Finds the value of the CLI configuration option.
*
* PHPUnit will use the last configuration argument on the command line, so this only returns
* the last configuration argument.
*
* @return string The value of the PHPUnit CLI configuration option
*/
private static function getPhpUnitCliConfigArgument()
{
$dir = null;
$reversedArgs = array_reverse($_SERVER['argv']);
foreach ($reversedArgs as $argIndex => $testArg) {
if (preg_match('/^-[^ \-]*c$/', $testArg) || $testArg === '--configuration') {
$dir = realpath($reversedArgs[$argIndex - 1]);
break;
} elseif (0 === strpos($testArg, '--configuration=')) {
$argPath = substr($testArg, strlen('--configuration='));
$dir = realpath($argPath);
break;
} elseif (0 === strpos($testArg, '-c')) {
$argPath = substr($testArg, strlen('-c'));
$dir = realpath($argPath);
break;
}
}
return $dir;
}
の内側に、この解決策を見つけ
$_SERVER['argv']
を使用して私の問題を解決しました