From db7d7ebd28f7046564510424ce41821c85b4eff2 Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 9 Feb 2011 17:21:39 +0000 Subject: [PATCH] Don't use ob_start/ob_get_contents/ob_end_clean just to var_dump() a string. Cleaning var_dump() usage. --- tests/parser/parserTest.inc | 3 +-- tests/phpunit/includes/parser/NewParserTest.php | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) 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()}" ); } -- 2.20.1