Merge "Allow passing detailed permission errors data to API"
[lhc/web/wiklou.git] / maintenance / preprocessorFuzzTest.php
index 498ddf6..4d38710 100644 (file)
@@ -64,7 +64,7 @@ class PPFuzzTester {
                                self::$currentTest = new PPFuzzTest( $this );
                                self::$currentTest->execute();
                                $passed = 'passed';
-                       } catch ( MWException $e ) {
+                       } catch ( Exception $e ) {
                                $testReport = self::$currentTest->getReport();
                                $exceptionReport = $e->getText();
                                $hash = md5( $testReport );
@@ -121,6 +121,7 @@ class PPFuzzTester {
                // It's done by the MW UI, so it's a reasonably legitimate thing to do.
                global $wgContLang;
                $s = $wgContLang->normalize( $s );
+
                return $s;
        }
 
@@ -136,7 +137,8 @@ class PPFuzzTester {
 
        function pickEntryPoint() {
                $count = count( $this->entryPoints );
-               return $this->entryPoints[ mt_rand( 0, $count - 1 ) ];
+
+               return $this->entryPoints[mt_rand( 0, $count - 1 )];
        }
 }
 
@@ -157,6 +159,7 @@ class PPFuzzTest {
 
        /**
         * @param Title $title
+        * @return array
         */
        function templateHook( $title ) {
                $titleText = $title->getPrefixedDBkey();
@@ -182,6 +185,7 @@ class PPFuzzTest {
                                'text' => $text,
                                'finalTitle' => $finalTitle );
                }
+
                return $this->templates[$titleText];
        }
 
@@ -208,10 +212,10 @@ class PPFuzzTest {
 
        function getReport() {
                $s = "Title: " . $this->title->getPrefixedDBkey() . "\n" .
-//                     "Output type: {$this->outputType}\n" .
+//                     "Output type: {$this->outputType}\n" .
                        "Entry point: {$this->entryPoint}\n" .
                        "User: " . ( $this->fancySig ? 'fancy' : 'no-fancy' ) .
-                               ' ' . var_export( $this->nickname, true ) . "\n" .
+                       ' ' . var_export( $this->nickname, true ) . "\n" .
                        "Main text: " . var_export( $this->mainText, true ) . "\n";
                foreach ( $this->templates as $titleText => $template ) {
                        $finalTitle = $template['finalTitle'];