2021-02-02 14:12:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Tests;
|
|
|
|
|
2021-10-11 22:40:27 +00:00
|
|
|
use MediaWikiIntegrationTestCase;
|
2021-02-02 14:12:51 +00:00
|
|
|
|
2021-10-11 22:40:27 +00:00
|
|
|
abstract class IntegrationTestCase extends MediaWikiIntegrationTestCase {
|
2021-02-02 14:12:51 +00:00
|
|
|
|
|
|
|
use TestUtils;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Setup the MW environment
|
|
|
|
*
|
|
|
|
* @param array $config
|
|
|
|
* @param array $data
|
|
|
|
*/
|
2021-07-22 07:25:13 +00:00
|
|
|
protected function setupEnv( array $config, array $data ): void {
|
2021-02-02 14:12:51 +00:00
|
|
|
$this->setMwGlobals( $config );
|
|
|
|
$this->setMwGlobals( [
|
|
|
|
'wgArticlePath' => $config['wgArticlePath'],
|
|
|
|
'wgNamespaceAliases' => $config['wgNamespaceIds'],
|
|
|
|
'wgMetaNamespace' => strtr( $config['wgFormattedNamespaces'][NS_PROJECT], ' ', '_' ),
|
|
|
|
'wgMetaNamespaceTalk' => strtr( $config['wgFormattedNamespaces'][NS_PROJECT_TALK], ' ', '_' ),
|
|
|
|
// TODO: Move this to $config
|
2021-12-01 22:25:19 +00:00
|
|
|
'wgLocaltimezone' => $data['localTimezone'],
|
|
|
|
// Data used for the tests assumes there are no variants for English.
|
|
|
|
// Language variants are tested using other languages.
|
|
|
|
'wgUsePigLatinVariant' => false,
|
2021-02-02 14:12:51 +00:00
|
|
|
] );
|
|
|
|
$this->setUserLang( $config['wgContentLanguage'] );
|
|
|
|
$this->setContentLang( $config['wgContentLanguage'] );
|
|
|
|
}
|
|
|
|
}
|