2021-02-02 14:12:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Tests;
|
|
|
|
|
2023-06-02 07:36:59 +00:00
|
|
|
use MediaWiki\MainConfigNames;
|
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 {
|
2023-06-02 07:36:59 +00:00
|
|
|
$this->overrideConfigValues( [
|
|
|
|
MainConfigNames::NamespaceAliases => $config['wgNamespaceIds'],
|
|
|
|
MainConfigNames::MetaNamespace => strtr( $config['wgFormattedNamespaces'][NS_PROJECT], ' ', '_' ),
|
|
|
|
MainConfigNames::MetaNamespaceTalk =>
|
|
|
|
strtr( $config['wgFormattedNamespaces'][NS_PROJECT_TALK], ' ', '_' ),
|
|
|
|
// TODO: Move this to $config
|
|
|
|
MainConfigNames::Localtimezone => $data['localTimezone'],
|
|
|
|
// Data used for the tests assumes there are no variants for English.
|
|
|
|
// Language variants are tested using other languages.
|
|
|
|
MainConfigNames::UsePigLatinVariant => false,
|
2022-07-30 22:02:17 +00:00
|
|
|
// Consistent defaults for generating canonical URLs
|
|
|
|
MainConfigNames::Server => 'https://example.org',
|
|
|
|
MainConfigNames::CanonicalServer => 'https://example.org',
|
2024-02-24 00:15:59 +00:00
|
|
|
MainConfigNames::ArticlePath => '/wiki/$1',
|
2023-06-02 07:36:59 +00:00
|
|
|
] + $config );
|
2021-02-02 14:12:51 +00:00
|
|
|
$this->setUserLang( $config['wgContentLanguage'] );
|
|
|
|
$this->setContentLang( $config['wgContentLanguage'] );
|
|
|
|
}
|
|
|
|
}
|