mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
8bbbf39bbd
Also merge setMwGlobals() calls because they are really expensive. Also utilize the more readable str_contains() and related. Change-Id: Iebde6aa17c2e366f0c0a98fe13a454f6a06c299b
32 lines
993 B
PHP
32 lines
993 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Tests;
|
|
|
|
use MediaWikiIntegrationTestCase;
|
|
|
|
abstract class IntegrationTestCase extends MediaWikiIntegrationTestCase {
|
|
|
|
use TestUtils;
|
|
|
|
/**
|
|
* Setup the MW environment
|
|
*
|
|
* @param array $config
|
|
* @param array $data
|
|
*/
|
|
protected function setupEnv( array $config, array $data ): void {
|
|
$this->setMwGlobals( [
|
|
'wgNamespaceAliases' => $config['wgNamespaceIds'],
|
|
'wgMetaNamespace' => strtr( $config['wgFormattedNamespaces'][NS_PROJECT], ' ', '_' ),
|
|
'wgMetaNamespaceTalk' => strtr( $config['wgFormattedNamespaces'][NS_PROJECT_TALK], ' ', '_' ),
|
|
// TODO: Move this to $config
|
|
'wgLocaltimezone' => $data['localTimezone'],
|
|
// Data used for the tests assumes there are no variants for English.
|
|
// Language variants are tested using other languages.
|
|
'wgUsePigLatinVariant' => false,
|
|
] + $config );
|
|
$this->setUserLang( $config['wgContentLanguage'] );
|
|
$this->setContentLang( $config['wgContentLanguage'] );
|
|
}
|
|
}
|