From 3da4732f130e3ed4a44e89dc440e99e981020628 Mon Sep 17 00:00:00 2001
From: Benaka Moorthi <benaka.moorthi@gmail.com>
Date: Tue, 14 May 2013 14:42:48 -0700
Subject: [PATCH] Got VisualPHPUnit to work with PHP 5.4.

---
 tests/lib/visualphpunit/app/lib/VPU.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/lib/visualphpunit/app/lib/VPU.php b/tests/lib/visualphpunit/app/lib/VPU.php
index af1f5cc0b6..5eef4d4b82 100755
--- a/tests/lib/visualphpunit/app/lib/VPU.php
+++ b/tests/lib/visualphpunit/app/lib/VPU.php
@@ -157,8 +157,11 @@ class VPU {
                     ++$i;
                 }
             } elseif ( $char == '{' ) {
+                $j = $i + 1;
+                while ($str{$j} === ' ' || $str{$j} === "\n" || $str{$j} === "\t") ++$j;
+
                 // Ensure we're only adding events to the array
-                if ( $nest == 0 && substr($str, $i, 8) != '{"event"' ) {
+                if ( $nest == 0 && substr($str, $j, 7) != '"event"' ) {
                     continue;
                 }
 
@@ -168,9 +171,9 @@ class VPU {
                 }
             } elseif ( $char == '}' && $nest > 0 ) {
                 if ( $nest == 1 ) {
-                    $tags[] = substr(
+                    $tags[] = trim(substr(
                         $str, $start_mark + 1, $i - $start_mark - 1
-                    );
+                    ));
                     $start_mark = $i;
                 }
                 $nest--;
-- 
GitLab