Skip to content

Instantly share code, notes, and snippets.

@lolli42
Created March 5, 2014 20:18
Show Gist options
  • Save lolli42/9375718 to your computer and use it in GitHub Desktop.
Save lolli42/9375718 to your computer and use it in GitHub Desktop.
diff --git a/Composer/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php b/Composer/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php
index 2737985..baba04e 100644
--- a/Composer/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php
+++ b/Composer/vendor/phpunit/phpunit/PHPUnit/Util/GlobalState.php
@@ -112,7 +112,7 @@ public static function backupGlobals(array $blacklist)
!in_array($key, $superGlobalArrays) &&
!in_array($key, $blacklist) &&
!$GLOBALS[$key] instanceof Closure) {
- self::$globals['GLOBALS'][$key] = serialize($GLOBALS[$key]);
+ self::$globals['GLOBALS'][$key] = $GLOBALS[$key];
}
}
}
@@ -138,16 +138,12 @@ public static function restoreGlobals(array $blacklist)
!in_array($key, $superGlobalArrays) &&
!in_array($key, $blacklist)) {
if (isset(self::$globals['GLOBALS'][$key])) {
- $GLOBALS[$key] = unserialize(
- self::$globals['GLOBALS'][$key]
- );
+ $GLOBALS[$key] = self::$globals['GLOBALS'][$key];
} else {
unset($GLOBALS[$key]);
}
}
}
-
- self::$globals = array();
}
protected static function backupSuperGlobalArray($superGlobalArray)
@lolli42
Copy link
Author

lolli42 commented Mar 16, 2014

Meanwhile, this hack is obsolete for TYPO3 CMS core. We drastically reduced unit test bootstrap and the globals are much smaller now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment