setMwGlobals( [ 'wgCookieWarningGeoIPServiceURL' => null ] ); $geoLocation = MediaWikiServices::getInstance()->getService( 'GeoLocation' ); $this->assertInstanceOf( NoopGeoLocation::class, $geoLocation ); } /** * @covers \CookieWarning\HttpGeoLocation */ public function testGeoLocationWithServiceURL() { $this->setMwGlobals( [ 'wgCookieWarningGeoIPServiceURL' => 'http://localhost/' ] ); $geoLocation = MediaWikiServices::getInstance()->getService( 'GeoLocation' ); $this->assertInstanceOf( HttpGeoLocation::class, $geoLocation ); } }