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 "ParserTestPrinter: use Shell class"
[lhc/web/wiklou.git]
/
tests
/
parser
/
ParserTestPrinter.php
diff --git
a/tests/parser/ParserTestPrinter.php
b/tests/parser/ParserTestPrinter.php
index
cad3a53
..
fddee3d
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
@@
-176,9
+178,6
@@
class ParserTestPrinter extends TestRecorder {
$outfile = "$prefix-$outFileTail";
$this->dumpToFile( $output, $outfile );
$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 ) {
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';
}
$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 );
@@
-280,6
+283,7
@@
class ParserTestPrinter extends TestRecorder {
/**
* Show a warning to the user
/**
* Show a warning to the user
+ * @param string $message
*/
public function warning( $message ) {
echo "$message\n";
*/
public function warning( $message ) {
echo "$message\n";
@@
-287,6
+291,8
@@
class ParserTestPrinter extends TestRecorder {
/**
* Mark a test skipped
/**
* Mark a test skipped
+ * @param string $test
+ * @param string $subtest
*/
public function skipped( $test, $subtest ) {
if ( $this->showProgress ) {
*/
public function skipped( $test, $subtest ) {
if ( $this->showProgress ) {
@@
-323,4
+329,3
@@
class ParserTestPrinter extends TestRecorder {
return ( $success == $total );
}
}
return ( $success == $total );
}
}
-