<?php
+use Wikimedia\TestingAccessWrapper;
+
/**
* @group API
* @group Database
}
public static function provideApiErrorFormatterCreation() {
- global $wgContLang;
-
return [
'Default (BC)' => [ [], [
'uselang' => 'ru',
'uselang=content' => [
[ 'uselang' => 'content', 'errorformat' => 'plaintext' ],
[
- 'uselang' => $wgContLang->getCode(),
+ 'uselang' => 'en',
'class' => ApiErrorFormatter::class,
- 'lang' => $wgContLang->getCode(),
+ 'lang' => 'en',
'format' => 'plaintext',
'usedb' => false,
]
[
'uselang' => 'ru',
'class' => ApiErrorFormatter::class,
- 'lang' => $wgContLang->getCode(),
+ 'lang' => 'en',
'format' => 'plaintext',
'usedb' => false,
]
);
}
- // Not static so $this->getMock() can be used
+ // Not static so $this can be used
public function provideExceptionErrors() {
$reqId = WebRequest::getRequestId();
$doclink = wfExpandUrl( wfScript( 'api' ) );
MWExceptionHandler::getRedactedTraceAsString( $ex )
)->inLanguage( 'en' )->useDatabase( false )->text();
- $dbex = new DBQueryError( $this->getMock( 'IDatabase' ), 'error', 1234, 'SELECT 1', __METHOD__ );
+ $dbex = new DBQueryError(
+ $this->createMock( 'IDatabase' ),
+ 'error', 1234, 'SELECT 1', __METHOD__ );
$dbtrace = wfMessage( 'api-exception-trace',
get_class( $dbex ),
$dbex->getFile(),