X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FWebRequestTest.php;h=041e7e3cd663289ec4b49db1efe11d501c677b7e;hp=aade4908600ec644e73268c6ef74e86c32a015f3;hb=bb9e1c1aa906b3c6c2c19eb48c33b635dee6af20;hpb=d9f412635fa4057a4b3b4d174b798c28dc54b038 diff --git a/tests/phpunit/includes/WebRequestTest.php b/tests/phpunit/includes/WebRequestTest.php index aade490860..041e7e3cd6 100644 --- a/tests/phpunit/includes/WebRequestTest.php +++ b/tests/phpunit/includes/WebRequestTest.php @@ -10,12 +10,10 @@ class WebRequestTest extends MediaWikiTestCase { parent::setUp(); $this->oldServer = $_SERVER; - IP::clearCaches(); } protected function tearDown() { $_SERVER = $this->oldServer; - IP::clearCaches(); parent::tearDown(); } @@ -367,7 +365,6 @@ class WebRequestTest extends MediaWikiTestCase { public function testGetIP( $expected, $input, $squid, $xffList, $private, $description ) { $_SERVER = $input; $this->setMwGlobals( [ - 'wgSquidServersNoPurge' => $squid, 'wgUsePrivateIPs' => $private, 'wgHooks' => [ 'IsTrustedProxy' => [ @@ -379,6 +376,8 @@ class WebRequestTest extends MediaWikiTestCase { ] ] ); + $this->setService( 'ProxyLookup', new ProxyLookup( [], $squid ) ); + $request = new WebRequest(); $result = $request->getIP(); $this->assertEquals( $expected, $result, $description ); @@ -564,6 +563,7 @@ class WebRequestTest extends MediaWikiTestCase { 'wgUsePrivateIPs' => false, 'wgHooks' => [], ] ); + $this->setService( 'ProxyLookup', new ProxyLookup( [], [] ) ); $request = new WebRequest(); # Next call throw an exception about lacking an IP