mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CookieWarning
synced 2024-12-03 18:26:18 +00:00
Use overrideConfigValues instead of setMwGlobals
Also use MainConfigNames. Change-Id: I4255b89b8f34fffe5bc70e73dfe7e9b6a4d69941
This commit is contained in:
parent
d1b64431e9
commit
30e24aa1b0
|
@ -19,10 +19,10 @@ class DecisionsTest extends MediaWikiIntegrationTestCase {
|
|||
* @throws MWException
|
||||
*/
|
||||
public function testShouldNotCallGeoLocationMultiple() {
|
||||
$this->setMwGlobals( [
|
||||
'wgCookieWarningEnabled' => true,
|
||||
'wgCookieWarningGeoIPLookup' => 'php',
|
||||
'wgCookieWarningForCountryCodes' => [ 'EU' => 'European Union' ],
|
||||
$this->overrideConfigValues( [
|
||||
'CookieWarningEnabled' => true,
|
||||
'CookieWarningGeoIPLookup' => 'php',
|
||||
'CookieWarningForCountryCodes' => [ 'EU' => 'European Union' ],
|
||||
] );
|
||||
|
||||
$geoLocation = $this->getMockBuilder( GeoLocation::class )
|
||||
|
|
|
@ -35,10 +35,10 @@ class HooksTest extends MediaWikiLangTestCase {
|
|||
$morelinkCookiePolicyMsg,
|
||||
$expectedLink
|
||||
): void {
|
||||
$this->setMwGlobals( [
|
||||
'wgCookieWarningEnabled' => $enabled,
|
||||
'wgCookieWarningMoreUrl' => $morelinkConfig,
|
||||
'wgCookieWarningForCountryCodes' => false,
|
||||
$this->overrideConfigValues( [
|
||||
'CookieWarningEnabled' => $enabled,
|
||||
'CookieWarningMoreUrl' => $morelinkConfig,
|
||||
'CookieWarningForCountryCodes' => false,
|
||||
] );
|
||||
MediaWikiServices::getInstance()->getMessageCache()->enable();
|
||||
|
||||
|
@ -165,10 +165,10 @@ class HooksTest extends MediaWikiLangTestCase {
|
|||
public function testOnSiteNoticeAfterGeoLocation( $ipAddress, $countryCodes,
|
||||
$expected
|
||||
) {
|
||||
$this->setMwGlobals( [
|
||||
'wgCookieWarningEnabled' => true,
|
||||
'wgCookieWarningGeoIPLookup' => is_array( $countryCodes ) ? 'php' : 'none',
|
||||
'wgCookieWarningForCountryCodes' => $countryCodes,
|
||||
$this->overrideConfigValues( [
|
||||
'CookieWarningEnabled' => true,
|
||||
'CookieWarningGeoIPLookup' => is_array( $countryCodes ) ? 'php' : 'none',
|
||||
'CookieWarningForCountryCodes' => $countryCodes,
|
||||
] );
|
||||
$this->mockGeoLocationService();
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ class ServiceWiringTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \CookieWarning\NoopGeoLocation
|
||||
*/
|
||||
public function testGeoLocationWithoutServiceURL() {
|
||||
$this->setMwGlobals( [
|
||||
'wgCookieWarningGeoIPServiceURL' => null
|
||||
$this->overrideConfigValues( [
|
||||
'CookieWarningGeoIPServiceURL' => null
|
||||
] );
|
||||
|
||||
$geoLocation = MediaWikiServices::getInstance()->getService( 'GeoLocation' );
|
||||
|
@ -26,8 +26,8 @@ class ServiceWiringTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \CookieWarning\HttpGeoLocation
|
||||
*/
|
||||
public function testGeoLocationWithServiceURL() {
|
||||
$this->setMwGlobals( [
|
||||
'wgCookieWarningGeoIPServiceURL' => 'http://localhost/'
|
||||
$this->overrideConfigValues( [
|
||||
'CookieWarningGeoIPServiceURL' => 'http://localhost/'
|
||||
] );
|
||||
|
||||
$geoLocation = MediaWikiServices::getInstance()->getService( 'GeoLocation' );
|
||||
|
|
Loading…
Reference in a new issue