stronk7

Untitled

May 7th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php
  2. index 844cc74ba94..e20d295f91d 100644
  3. --- a/lib/phpunit/classes/util.php
  4. +++ b/lib/phpunit/classes/util.php
  5. @@ -327,6 +327,8 @@ class phpunit_util extends testing_util {
  6. public static function bootstrap_init() {
  7. global $CFG, $SITE, $DB, $FULLME;
  8.  
  9. + print_object ('BOOTSTRAP');
  10. +
  11. // backup the globals
  12. self::$globals['_SERVER'] = $_SERVER;
  13. self::$globals['CFG'] = clone($CFG);
  14. @@ -362,7 +364,15 @@ class phpunit_util extends testing_util {
  15. }
  16. if (isset(self::$globals[$name])) {
  17. if (is_object(self::$globals[$name])) {
  18. - $return = clone(self::$globals[$name]);
  19. + $return = unserialize(serialize(self::$globals[$name]));
  20. + if ($name == 'SITE') {
  21. + print_object(get_class(self::$globals[$name]));
  22. + if (isset($return->id)) {
  23. + if ($return->id != 1) {
  24. + print_object('SITE->id changed to ' . $return->id);
  25. + }
  26. + }
  27. + }
  28. return $return;
  29. } else {
  30. return self::$globals[$name];
Advertisement
Add Comment
Please, Sign In to add comment