summaryrefslogtreecommitdiff
path: root/maintenance/preprocessorFuzzTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
committerPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
commit9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch)
tree46d1a0dee7febef5c2d57a9f7b972be16a163b3d /maintenance/preprocessorFuzzTest.php
parent78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff)
update to MediaWiki 1.17.0
Diffstat (limited to 'maintenance/preprocessorFuzzTest.php')
-rw-r--r--maintenance/preprocessorFuzzTest.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/maintenance/preprocessorFuzzTest.php b/maintenance/preprocessorFuzzTest.php
index c271b117..31b372c2 100644
--- a/maintenance/preprocessorFuzzTest.php
+++ b/maintenance/preprocessorFuzzTest.php
@@ -4,28 +4,28 @@
* @ingroup Maintenance
*/
-require_once( dirname(__FILE__) . '/commandLine.inc' );
+require_once( dirname( __FILE__ ) . '/commandLine.inc' );
$wgHooks['BeforeParserFetchTemplateAndtitle'][] = 'PPFuzzTester::templateHook';
class PPFuzzTester {
var $hairs = array(
- '[[', ']]', '{{', '{{', '}}', '}}', '{{{', '}}}',
+ '[[', ']]', '{{', '{{', '}}', '}}', '{{{', '}}}',
'<', '>', '<nowiki', '<gallery', '</nowiki>', '</gallery>', '<nOwIkI>', '</NoWiKi>',
'<!--' , '-->',
"\n==", "==\n",
'|', '=', "\n", ' ', "\t", "\x7f",
'~~', '~~~', '~~~~', 'subst:',
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
// extensions
- //'<ref>', '</ref>', '<references/>',
+ // '<ref>', '</ref>', '<references/>',
);
var $minLength = 0;
var $maxLength = 20;
var $maxTemplates = 5;
- //var $outputTypes = array( 'OT_HTML', 'OT_WIKI', 'OT_PREPROCESS' );
+ // var $outputTypes = array( 'OT_HTML', 'OT_WIKI', 'OT_PREPROCESS' );
var $entryPoints = array( 'testSrvus', 'testPst', 'testPreprocess' );
var $verbose = false;
static $currentTest = false;
@@ -51,7 +51,7 @@ class PPFuzzTester {
$exceptionReport = $e->getText();
$hash = md5( $testReport );
file_put_contents( "results/ppft-$hash.in", serialize( self::$currentTest ) );
- file_put_contents( "results/ppft-$hash.fail",
+ file_put_contents( "results/ppft-$hash.fail",
"Input:\n$testReport\n\nException report:\n$exceptionReport\n" );
print "Test $hash failed\n";
$passed = 'failed';
@@ -99,7 +99,7 @@ class PPFuzzTester {
$s .= $this->hairs[$hairIndex];
}
// Send through the UTF-8 normaliser
- // This resolves a few differences between the old preprocessor and the
+ // This resolves a few differences between the old preprocessor and the
// XML-based one, which doesn't like illegals and converts line endings.
// It's done by the MW UI, so it's a reasonably legitimate thing to do.
global $wgContLang;
@@ -131,16 +131,16 @@ class PPFuzzTest {
$this->parent = $tester;
$this->mainText = $tester->makeInputText();
$this->title = $tester->makeTitle();
- //$this->outputType = $tester->pickOutputType();
+ // $this->outputType = $tester->pickOutputType();
$this->entryPoint = $tester->pickEntryPoint();
- $this->nickname = $tester->makeInputText( $wgMaxSigChars + 10);
+ $this->nickname = $tester->makeInputText( $wgMaxSigChars + 10 );
$this->fancySig = (bool)mt_rand( 0, 1 );
$this->templates = array();
}
function templateHook( $title ) {
$titleText = $title->getPrefixedDBkey();
-
+
if ( !isset( $this->templates[$titleText] ) ) {
$finalTitle = $title;
if ( count( $this->templates ) >= $this->parent->maxTemplates ) {
@@ -182,9 +182,9 @@ class PPFuzzTest {
function getReport() {
$s = "Title: " . $this->title->getPrefixedDBkey() . "\n" .
-// "Output type: {$this->outputType}\n" .
- "Entry point: {$this->entryPoint}\n" .
- "User: " . ( $this->fancySig ? 'fancy' : 'no-fancy' ) . ' ' . var_export( $this->nickname, true ) . "\n" .
+// "Output type: {$this->outputType}\n" .
+ "Entry point: {$this->entryPoint}\n" .
+ "User: " . ( $this->fancySig ? 'fancy' : 'no-fancy' ) . ' ' . var_export( $this->nickname, true ) . "\n" .
"Main text: " . var_export( $this->mainText, true ) . "\n";
foreach ( $this->templates as $titleText => $template ) {
$finalTitle = $template['finalTitle'];