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:
parent
516b227bba
commit
ec28fcb09e
1 changed files with 12 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue