From: Marius Hoch Date: Fri, 19 May 2017 18:50:58 +0000 (+0200) Subject: Add workaround for HHVM issue 6206 X-Git-Tag: 1.31.0-rc.0~3221^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=c2c7452577e;p=lhc%2Fweb%2Fwiklou.git Add workaround for HHVM issue 6206 Just use the actual global on HHVM, like we do on Zend, but avoid hitting the warning. This is a workaround for https://github.com/facebook/hhvm/issues/6206 Bug: T111641 Change-Id: I15ef0e90827c94a8b2609484b0dddcb78f04284c --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index bc9f97c5d9..1114f2ae62 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -1,5 +1,6 @@ mwGlobals[$globalKey] = clone $GLOBALS[$globalKey]; + } elseif ( $GLOBALS[$globalKey] instanceof Closure ) { + // Serializing Closure only gives a warning on HHVM while + // it throws an Exception on Zend. + // Workaround for https://github.com/facebook/hhvm/issues/6206 + $this->mwGlobals[$globalKey] = $GLOBALS[$globalKey]; } else { try { $this->mwGlobals[$globalKey] = unserialize( serialize( $GLOBALS[$globalKey] ) );