mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CookieWarning
synced 2024-11-23 13:56:53 +00:00
156193fe88
Change-Id: I7139a34a6373edd8bd6f42d8716260ef2164e8de
37 lines
897 B
PHP
37 lines
897 B
PHP
<?php
|
|
|
|
namespace CookieWarning\Tests;
|
|
|
|
use CookieWarning\HttpGeoLocation;
|
|
use CookieWarning\NoopGeoLocation;
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
class ServiceWiringTest extends MediaWikiIntegrationTestCase {
|
|
|
|
/**
|
|
* @covers \CookieWarning\NoopGeoLocation
|
|
*/
|
|
public function testGeoLocationWithoutServiceURL() {
|
|
$this->overrideConfigValues( [
|
|
'CookieWarningGeoIPServiceURL' => null
|
|
] );
|
|
|
|
$geoLocation = $this->getServiceContainer()->getService( 'GeoLocation' );
|
|
|
|
$this->assertInstanceOf( NoopGeoLocation::class, $geoLocation );
|
|
}
|
|
|
|
/**
|
|
* @covers \CookieWarning\HttpGeoLocation
|
|
*/
|
|
public function testGeoLocationWithServiceURL() {
|
|
$this->overrideConfigValues( [
|
|
'CookieWarningGeoIPServiceURL' => 'http://localhost/'
|
|
] );
|
|
|
|
$geoLocation = $this->getServiceContainer()->getService( 'GeoLocation' );
|
|
|
|
$this->assertInstanceOf( HttpGeoLocation::class, $geoLocation );
|
|
}
|
|
}
|