Don't use ob_start/ob_get_contents/ob_end_clean just to var_dump() a string. Cleaning...
authorPlatonides <platonides@users.mediawiki.org>
Wed, 9 Feb 2011 17:21:39 +0000 (17:21 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 9 Feb 2011 17:21:39 +0000 (17:21 +0000)
tests/parser/parserTest.inc
tests/phpunit/includes/parser/NewParserTest.php

index aeaf593..9315422 100644 (file)
@@ -249,8 +249,7 @@ class ParserTest {
                        if ( $fail ) {
                                echo "Test failed with seed {$this->fuzzSeed}\n";
                                echo "Input:\n";
-                               var_dump( $input );
-                               echo "\n\n";
+                               printf( "string(%d) \"%s\"\n\n", strlen( $input ), $input );
                                echo "$exception\n";
                        } else {
                                $numSuccess++;
index 5adbfe6..d957509 100644 (file)
@@ -504,11 +504,7 @@ class NewParserTest extends MediaWikiTestCase {
                                $parser->parse( $input, $title, $opts );
                                $this->assertTrue( true, "Test $id, fuzz seed {$this->fuzzSeed}" );
                        } catch ( Exception $exception ) {
-                               
-                               ob_start();
-                               var_dump( $input );
-                               $input_dump = ob_get_contents();
-                               ob_end_clean();
+                               $input_dump = sprintf( "string(%d) \"%s\"\n", strlen( $input ), $input );
                                
                                $this->assertTrue( false, "Test $id, fuzz seed {$this->fuzzSeed}. \n\nInput: $input_dump\n\nError: {$exception->getMessage()}\n\nBacktrace: {$exception->getTraceAsString()}" );
                        }