From c2c7452577eb95a5586d1de6f586c28b13ac3951 Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Fri, 19 May 2017 20:50:58 +0200 Subject: [PATCH 1/1] 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 --- tests/phpunit/MediaWikiTestCase.php | 6 ++++++ 1 file changed, 6 insertions(+) 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] ) ); -- 2.20.1