From 3b9d758274ed1eca11b40f10810b7c0dd6aaca7a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 28 Jul 2017 18:02:28 -0700 Subject: [PATCH] phpunit: Fix failing DeprecatedGlobalTest on HHVM at Travis CI Follows-up 1d77070f19e3. On Travis CI, this test fails on HHVM: > There was 1 failure: > 1) DeprecatedGlobalTest::testWarning > Failed asserting that exception of type "PHPUnit_Framework_Error" is thrown. I've been unable to reproduce this locally, but within Travis CI it happens on both Trusty containers and Trusty VMs, no matter the version of HHVM. After some trial and error, I narrowed it down to the error_reporting setting, which presumably has a different default in the HHVM package Travis CI uses. Change-Id: I588218103d6c72df5ad4fb6289df688b3740233e --- tests/phpunit/includes/DeprecatedGlobalTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/phpunit/includes/DeprecatedGlobalTest.php b/tests/phpunit/includes/DeprecatedGlobalTest.php index 802f9b1480..237e3fb7b7 100644 --- a/tests/phpunit/includes/DeprecatedGlobalTest.php +++ b/tests/phpunit/includes/DeprecatedGlobalTest.php @@ -22,6 +22,17 @@ * @covers DeprecatedGlobal */ class DeprecatedGlobalTest extends MediaWikiTestCase { + + public function setUp() { + parent::setUp(); + $this->oldErrorLevel = error_reporting( -1 ); + } + + public function tearDown() { + error_reporting( $this->oldErrorLevel ); + parent::tearDown(); + } + public function testObjectDeStub() { global $wgDummy; -- 2.20.1