MediaWiki REL1_33
|
This is a TestRecorder responsible for printing information about progress, success and failure to the console. More...
Public Member Functions | |
__construct ( $term, $options) | |
endSuite ( $path) | |
Called after ending an input file. | |
record ( $test, ParserTestResult $result) | |
Called after each test. | |
report () | |
Called before finishing the test run. | |
skipped ( $test, $subtest) | |
Mark a test skipped. | |
start () | |
Called at beginning of the parser test run. | |
startSuite ( $path) | |
Show "Reading tests from ...". | |
startTest ( $test) | |
Called before starting a test. | |
warning ( $message) | |
Show a warning to the user. | |
Public Member Functions inherited from TestRecorder | |
end () | |
Called at the end of the parser test run. | |
Private Member Functions | |
colorDiff ( $text) | |
Colorize unified diff output if set for ANSI color output. | |
dumpToFile ( $data, $filename) | |
Write the given string to a file, adding a final newline. | |
extractFragment ( $text, $position) | |
quickDiff ( $input, $output, $inFileTail='expected', $outFileTail='actual') | |
Run given strings through a diff and return the (colorized) output. | |
reportPercentage ( $success, $total) | |
showFailure (ParserTestResult $testResult) | |
Print a failure message and provide some explanatory output about what went wrong if so configured. | |
showSuccess (ParserTestResult $testResult) | |
Print a happy success message. | |
showTesting ( $desc) | |
wellFormed ( $text) | |
Private Attributes | |
$markWhitespace | |
$showDiffs | |
$showFailure | |
$showOutput | |
$showProgress | |
$skipped | |
$success | |
$term | |
$total | |
$useDwdiff | |
$xmlError | |
This is a TestRecorder responsible for printing information about progress, success and failure to the console.
It is specific to the parserTests.php frontend.
Definition at line 29 of file ParserTestPrinter.php.
ParserTestPrinter::__construct | ( | $term, | |
$options | |||
) |
Definition at line 42 of file ParserTestPrinter.php.
References $options, $term, showFailure(), and term().
|
private |
Colorize unified diff output if set for ANSI color output.
Subtractions are colored blue, additions red.
string | $text |
Definition at line 224 of file ParserTestPrinter.php.
References term().
Referenced by quickDiff().
|
private |
Write the given string to a file, adding a final newline.
string | $data | |
string | $filename |
Definition at line 211 of file ParserTestPrinter.php.
Referenced by quickDiff().
ParserTestPrinter::endSuite | ( | $path | ) |
Called after ending an input file.
Reimplemented from TestRecorder.
Definition at line 88 of file ParserTestPrinter.php.
References print.
|
private |
Definition at line 259 of file ParserTestPrinter.php.
References term().
Referenced by wellFormed().
|
private |
Run given strings through a diff and return the (colorized) output.
Requires writable /tmp directory and a 'diff' command in the PATH.
string | $input | |
string | $output | |
string | $inFileTail | Tailing for the input file name |
string | $outFileTail | Tailing for the output file name |
Definition at line 158 of file ParserTestPrinter.php.
References $input, $output, $wgDiff3, colorDiff(), dumpToFile(), wfIsWindows(), and wfTempDir().
Referenced by showFailure().
ParserTestPrinter::record | ( | $test, | |
ParserTestResult | $result | ||
) |
Called after each test.
array | $test | |
ParserTestResult | $result |
Reimplemented from TestRecorder.
Definition at line 92 of file ParserTestPrinter.php.
References showFailure(), and showSuccess().
ParserTestPrinter::report | ( | ) |
Called before finishing the test run.
Reimplemented from TestRecorder.
Definition at line 304 of file ParserTestPrinter.php.
References print, reportPercentage(), and term().
|
private |
Definition at line 312 of file ParserTestPrinter.php.
References $success, $total, print, skipped(), term(), and wfPercent().
Referenced by report().
|
private |
Print a failure message and provide some explanatory output about what went wrong if so configured.
ParserTestResult | $testResult |
Definition at line 122 of file ParserTestPrinter.php.
References ParserTestResult\getDescription(), print, quickDiff(), showFailure(), showTesting(), term(), and wellFormed().
Referenced by __construct(), record(), and showFailure().
|
private |
Print a happy success message.
ParserTestResult | $testResult |
Definition at line 109 of file ParserTestPrinter.php.
Referenced by record().
|
private |
Definition at line 72 of file ParserTestPrinter.php.
References print.
Referenced by showFailure(), and startTest().
ParserTestPrinter::skipped | ( | $test, | |
$subtest | |||
) |
Mark a test skipped.
string | $test | |
string | $subtest |
Reimplemented from TestRecorder.
Definition at line 297 of file ParserTestPrinter.php.
References print, skipped(), and term().
Referenced by reportPercentage(), skipped(), and start().
ParserTestPrinter::start | ( | ) |
Called at beginning of the parser test run.
Reimplemented from TestRecorder.
Definition at line 60 of file ParserTestPrinter.php.
References skipped().
ParserTestPrinter::startSuite | ( | $path | ) |
Show "Reading tests from ...".
string | $path |
Reimplemented from TestRecorder.
Definition at line 81 of file ParserTestPrinter.php.
ParserTestPrinter::startTest | ( | $test | ) |
Called before starting a test.
Reimplemented from TestRecorder.
Definition at line 66 of file ParserTestPrinter.php.
References showTesting().
ParserTestPrinter::warning | ( | $message | ) |
Show a warning to the user.
string | $message |
Reimplemented from TestRecorder.
Definition at line 288 of file ParserTestPrinter.php.
|
private |
Definition at line 232 of file ParserTestPrinter.php.
References $html, $parser, and extractFragment().
Referenced by showFailure().
|
private |
Definition at line 39 of file ParserTestPrinter.php.
|
private |
Definition at line 34 of file ParserTestPrinter.php.
|
private |
Definition at line 36 of file ParserTestPrinter.php.
|
private |
Definition at line 37 of file ParserTestPrinter.php.
|
private |
Definition at line 35 of file ParserTestPrinter.php.
|
private |
Definition at line 32 of file ParserTestPrinter.php.
|
private |
Definition at line 31 of file ParserTestPrinter.php.
Referenced by reportPercentage().
|
private |
Definition at line 33 of file ParserTestPrinter.php.
Referenced by __construct().
|
private |
Definition at line 30 of file ParserTestPrinter.php.
Referenced by reportPercentage().
|
private |
Definition at line 38 of file ParserTestPrinter.php.
|
private |
Definition at line 40 of file ParserTestPrinter.php.