+ if ( $this->hasOption( 'with-phpunitclass' ) ) {
+ global $wgPhpUnitClass;
+ $wgPhpUnitClass = $this->getOption( 'with-phpunitclass' );
+
+ # Cleanup $args array so the option and its value do not
+ # pollute PHPUnit
+ $key = array_search( '--with-phpunitclass', $_SERVER['argv'] );
+ unset( $_SERVER['argv'][$key] ); // the option
+ unset( $_SERVER['argv'][$key + 1] ); // its value
+ $_SERVER['argv'] = array_values( $_SERVER['argv'] );
+ }
+