tests: Prevent leaking $_SERVER in RequestFromGlobalsTest

These tests modified $_SERVER, but did not restore it afterwards,
which caused trouble for MediaWikiTest.

Bug: T342192
Change-Id: If8084381b91f2a79fdaaf6d96dbf5fe625410297
This commit is contained in:
mainframe98 2023-07-19 09:22:29 +02:00
parent 516b227bba
commit ec28fcb09e

View file

@ -14,9 +14,21 @@ class RequestFromGlobalsTest extends MediaWikiIntegrationTestCase {
*/
private $reqFromGlobals;
/**
* @var array
*/
private $oldServer;
protected function setUp(): void {
parent::setUp();
$this->reqFromGlobals = new RequestFromGlobals();
$this->oldServer = $_SERVER;
}
protected function tearDown(): void {
$_SERVER = $this->oldServer;
parent::tearDown();
}
/**