From: Platonides Date: Wed, 9 Feb 2011 17:21:39 +0000 (+0000) Subject: Don't use ob_start/ob_get_contents/ob_end_clean just to var_dump() a string. Cleaning... X-Git-Tag: 1.31.0-rc.0~32092 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/?a=commitdiff_plain;h=db7d7ebd28f7046564510424ce41821c85b4eff2;p=lhc%2Fweb%2Fwiklou.git Don't use ob_start/ob_get_contents/ob_end_clean just to var_dump() a string. Cleaning var_dump() usage. --- diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index aeaf593cd6..93154220ac 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -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++; diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index 5adbfe6f68..d9575097d2 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -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()}" ); }