Created
June 4, 2011 19:02
-
-
Save motin/1008206 to your computer and use it in GitHub Desktop.
Patch for liv/VPU.php (https://github.com/NSinopoli/VisualPHPUnit/issues/9)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Base (BASE) | |
+++ Locally Modified (Based On LOCAL) | |
@@ -648,13 +651,16 @@ | |
$length = strlen($str); | |
for ( $i=0; $i < $length; $i++ ) { | |
$char = $str{$i}; | |
if ( $char == '{' ) { | |
+ if ($nest == 0 && substr($str, $i, 18) != '{"event"') continue; | |
$nest++; | |
if ( $nest == 1 ) { | |
$start_mark = $i; | |
} | |
- } elseif ( $char == '}' ) { | |
+ } elseif ( $char == '}' && $nest > 0) { | |
if ( $nest == 1 ) { | |
$tags[] = substr($str, $start_mark + 1, $i - $start_mark - 1); | |
$start_mark = $i; | |
@@ -727,11 +733,17 @@ | |
$result = new PHPUnit_Framework_TestResult; | |
$result->addListener(new PHPUnit_Util_Log_JSON); | |
+ // We need to temporarily turn off html_errors to ensure correct parsing of test debug output | |
+ $html_errors = ini_get("html_errors"); | |
ob_start(); | |
+ ini_set("html_errors", 0); | |
$suite->run($result); | |
$results = ob_get_contents(); | |
+ ini_set("html_errors", $html_errors); | |
ob_end_clean(); | |
return $this->_compile_suites($results); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment