X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FParserTestPrinter.php;h=fddee3d28fee012ba75772c1f07b610ad10e6032;hb=ad029240a201d8021a6657e26ca32e9033fca7b5;hp=ac9f1509455106a56a617baa41bf7844e352c10a;hpb=a081832b8af5b7a3c390b44eba2492c54464f6eb;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/ParserTestPrinter.php b/tests/parser/ParserTestPrinter.php index ac9f150945..fddee3d28f 100644 --- a/tests/parser/ParserTestPrinter.php +++ b/tests/parser/ParserTestPrinter.php @@ -19,6 +19,8 @@ * @ingroup Testing */ +use MediaWiki\Shell\Shell; + /** * This is a TestRecorder responsible for printing information about progress, * success and failure to the console. It is specific to the parserTests.php @@ -176,9 +178,6 @@ class ParserTestPrinter extends TestRecorder { $outfile = "$prefix-$outFileTail"; $this->dumpToFile( $output, $outfile ); - $shellInfile = wfEscapeShellArg( $infile ); - $shellOutfile = wfEscapeShellArg( $outfile ); - global $wgDiff3; // we assume that people with diff3 also have usual diff if ( $this->useDwdiff ) { @@ -187,7 +186,11 @@ class ParserTestPrinter extends TestRecorder { $shellCommand = ( wfIsWindows() && !$wgDiff3 ) ? 'fc' : 'diff -au'; } - $diff = wfShellExec( "$shellCommand $shellInfile $shellOutfile" ); + $result = Shell::command() + ->unsafeParams( $shellCommand ) + ->params( $infile, $outfile ) + ->execute(); + $diff = $result->getStdout(); unlink( $infile ); unlink( $outfile ); @@ -280,6 +283,7 @@ class ParserTestPrinter extends TestRecorder { /** * Show a warning to the user + * @param string $message */ public function warning( $message ) { echo "$message\n"; @@ -287,6 +291,8 @@ class ParserTestPrinter extends TestRecorder { /** * Mark a test skipped + * @param string $test + * @param string $subtest */ public function skipped( $test, $subtest ) { if ( $this->showProgress ) {