r81829 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81828‎ | r81829 | r81830 >
Date:17:21, 9 February 2011
Author:platonides
Status:ok
Tags:
Comment:
Don't use ob_start/ob_get_contents/ob_end_clean just to var_dump() a string. Cleaning var_dump() usage.
Modified paths:
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php
@@ -504,12 +504,8 @@
505505 $parser->parse( $input, $title, $opts );
506506 $this->assertTrue( true, "Test $id, fuzz seed {$this->fuzzSeed}" );
507507 } catch ( Exception $exception ) {
 508+ $input_dump = sprintf( "string(%d) \"%s\"\n", strlen( $input ), $input );
508509
509 - ob_start();
510 - var_dump( $input );
511 - $input_dump = ob_get_contents();
512 - ob_end_clean();
513 -
514510 $this->assertTrue( false, "Test $id, fuzz seed {$this->fuzzSeed}. \n\nInput: $input_dump\n\nError: {$exception->getMessage()}\n\nBacktrace: {$exception->getTraceAsString()}" );
515511 }
516512
Index: trunk/phase3/tests/parser/parserTest.inc
@@ -249,8 +249,7 @@
250250 if ( $fail ) {
251251 echo "Test failed with seed {$this->fuzzSeed}\n";
252252 echo "Input:\n";
253 - var_dump( $input );
254 - echo "\n\n";
 253+ printf( "string(%d) \"%s\"\n\n", strlen( $input ), $input );
255254 echo "$exception\n";
256255 } else {
257256 $numSuccess++;

Follow-up revisions

RevisionCommit summaryAuthorDate
r81831Follow up to r81829. Poison var_dump, so that debug statements like r81671 ca...platonides17:36, 9 February 2011

Status & tagging log