From 24ed00e74e8b5e3c08fcd714d0e5f82467571779 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Sat, 9 Feb 2019 22:25:57 -0800 Subject: [PATCH] ParserTestPrinter: use Shell class Change-Id: I9e2eb3b01a9907d72e3edaa6660a4057d513942e --- tests/parser/ParserTestPrinter.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/parser/ParserTestPrinter.php b/tests/parser/ParserTestPrinter.php index 94d226c1d5..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 ); -- 2.20.1