dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix categories detele SPARQL clause"
[lhc/web/wiklou.git]
/
tests
/
parser
/
ParserTestPrinter.php
diff --git
a/tests/parser/ParserTestPrinter.php
b/tests/parser/ParserTestPrinter.php
index
94d226c
..
34f8cd5
100644
(file)
--- a/
tests/parser/ParserTestPrinter.php
+++ b/
tests/parser/ParserTestPrinter.php
@@
-19,6
+19,8
@@
* @ingroup Testing
*/
* @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
/**
* This is a TestRecorder responsible for printing information about progress,
* success and failure to the console. It is specific to the parserTests.php
@@
-166,19
+168,12
@@
class ParserTestPrinter extends TestRecorder {
$output = strtr( $output, $pairs );
}
$output = strtr( $output, $pairs );
}
- # Windows, or at least the fc utility, is retarded
- $slash = wfIsWindows() ? '\\' : '/';
- $prefix = wfTempDir() . "{$slash}mwParser-" . mt_rand();
-
- $infile = "$prefix-$inFileTail";
+ $infile = tempnam( wfTempDir(), "mwParser-$inFileTail" );
$this->dumpToFile( $input, $infile );
$this->dumpToFile( $input, $infile );
- $outfile =
"$prefix-$outFileTail"
;
+ $outfile =
tempnam( wfTempDir(), "mwParser-$outFileTail" )
;
$this->dumpToFile( $output, $outfile );
$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 ) {
global $wgDiff3;
// we assume that people with diff3 also have usual diff
if ( $this->useDwdiff ) {
@@
-187,7
+182,11
@@
class ParserTestPrinter extends TestRecorder {
$shellCommand = ( wfIsWindows() && !$wgDiff3 ) ? 'fc' : 'diff -au';
}
$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 );
unlink( $infile );
unlink( $outfile );