X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FWebRequestTest.php;h=041e7e3cd663289ec4b49db1efe11d501c677b7e;hb=2466e6365c2c356b35794c059c3f0937e111a067;hp=aade4908600ec644e73268c6ef74e86c32a015f3;hpb=65d7d79d1ba09afc362f9e542b7df97b7ecc9c3e;p=lhc%2Fweb%2Fwiklou.git 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