class ContentHandlerTest extends MediaWikiTestCase {
protected function setUp() {
- global $wgContLang;
parent::setUp();
$this->setMwGlobals( [
],
] );
- // Reset namespace cache
- MWNamespace::clearCaches();
- $wgContLang->resetNamespaces();
- // And LinkCache
+ // Reset LinkCache
MediaWikiServices::getInstance()->resetServiceForTesting( 'LinkCache' );
}
protected function tearDown() {
- global $wgContLang;
-
- // Reset namespace cache
- MWNamespace::clearCaches();
- $wgContLang->resetNamespaces();
- // And LinkCache
+ // Reset LinkCache
MediaWikiServices::getInstance()->resetServiceForTesting( 'LinkCache' );
parent::tearDown();
* page.
*/
public function testGetAutosummary() {
- $this->setMwGlobals( 'wgContLang', Language::factory( 'en' ) );
+ $this->setContentLang( 'en' );
$content = new DummyContentHandlerForTesting( CONTENT_MODEL_WIKITEXT );
$title = Title::newFromText( 'Help:Test' );