phpunit: parse any --boostrap parameter in getopt() call

This is needed in case such a parameter exists so that --configuration
will be recognized. This is due to how getopt() stops looking once
it finds an unrecognized field.

So long as the order is "configuration" first, the other options all
work and get passed through to phpunit. But, paratest specifies
bootstrap before configuration, which means this subclass won't see
"configuration".

Follows-up 204776e42c, after which stopped working.

Bug: T50217
Change-Id: I47fa647a9b26f099f6a399f256d8154bb20c4c17
This commit is contained in:
Aaron Schulz 2022-03-31 20:47:26 -07:00 committed by Krinkle
parent ae2c5303b7
commit 34ea1349b8

View file

@ -108,8 +108,8 @@ class PHPUnitMaintClass {
$command = new Command();
$args = $_SERVER['argv'];
$hasConfigOpt = (bool)getopt( 'c:', [ 'configuration:' ] );
if ( !$hasConfigOpt ) {
$knownOpts = getopt( 'c:', [ 'configuration:', 'bootstrap:' ] ) ?: [];
if ( !isset( $knownOpts['c'] ) && !isset( $knownOpts['configuration'] ) ) {
// XXX HAX: Use our default file. This is a temporary hack, to be removed when this file goes away
// or when T227900 is resolved.
$args[] = '--configuration=' . __DIR__ . '/suite.xml';