aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiMainTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/api/ApiMainTest.php')
-rw-r--r--tests/phpunit/includes/api/ApiMainTest.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/phpunit/includes/api/ApiMainTest.php b/tests/phpunit/includes/api/ApiMainTest.php
index 534f118cf7f6..e967464c583f 100644
--- a/tests/phpunit/includes/api/ApiMainTest.php
+++ b/tests/phpunit/includes/api/ApiMainTest.php
@@ -1,5 +1,6 @@
<?php
+use MediaWiki\MainConfigNames;
use MediaWiki\Permissions\Authority;
use MediaWiki\Tests\Unit\Permissions\MockAuthorityTrait;
use Wikimedia\Rdbms\DBConnRef;
@@ -313,7 +314,7 @@ class ApiMainTest extends ApiTestCase {
// it does fail.
$now = time();
- $this->setMwGlobals( 'wgCacheEpoch', '20030516000000' );
+ $this->overrideConfigValue( MainConfigNames::CacheEpoch, '20030516000000' );
$mock = $this->createMock( ApiBase::class );
$mock->method( 'getModuleName' )->willReturn( 'testmodule' );
@@ -378,7 +379,7 @@ class ApiMainTest extends ApiTestCase {
$this->expectException( ApiUsageException::class );
$this->expectExceptionMessage( 'Waiting for a database server: 4 seconds lagged.' );
- $this->setMwGlobals( 'wgShowHostnames', false );
+ $this->overrideConfigValue( MainConfigNames::ShowHostnames, false );
$this->doTestCheckMaxLag( 4 );
}
@@ -387,7 +388,7 @@ class ApiMainTest extends ApiTestCase {
$this->expectException( ApiUsageException::class );
$this->expectExceptionMessage( 'Waiting for somehost: 4 seconds lagged.' );
- $this->setMwGlobals( 'wgShowHostnames', true );
+ $this->overrideConfigValue( MainConfigNames::ShowHostnames, true );
$this->doTestCheckMaxLag( 4 );
}
@@ -516,11 +517,11 @@ class ApiMainTest extends ApiTestCase {
$priv->mInternalMode = false;
if ( !empty( $options['cdn'] ) ) {
- $this->setMwGlobals( 'wgUseCdn', true );
+ $this->overrideConfigValue( MainConfigNames::UseCdn, true );
}
// Can't do this in TestSetup.php because Setup.php will override it
- $this->setMwGlobals( 'wgCacheEpoch', '20030516000000' );
+ $this->overrideConfigValue( MainConfigNames::CacheEpoch, '20030516000000' );
$module = $this->getMockBuilder( ApiBase::class )
->setConstructorArgs( [ $api, 'mock' ] )