0,
'iw_api' => '/w/api.php',
'iw_url' => ''
];
$this->overrideConfigValue(
MainConfigNames::InterwikiCache,
ClassicInterwikiLookup::buildCdbHash( [
[
'iw_prefix' => 'en',
'iw_url' => 'https://en.wikipedia.org/wiki/$1',
'iw_wikiid' => 'enwiki',
] + $defaults,
[
'iw_prefix' => 'google',
'iw_url' => 'https://google.com/?q=$1',
'iw_wikiid' => 'google',
] + $defaults,
] )
);
$this->getServiceContainer()->resetServiceForTesting( 'InterwikiLookup' );
}
public static function provideGetParserOutput() {
yield 'Basic render' => [
'title' => 'WikitextContentTest_testGetParserOutput',
'model' => CONTENT_MODEL_WIKITEXT,
'text' => "hello ''world''\n",
'expectedHtml' => "
', $actual );
$this->assertMatchesRegularExpression( '!
]+>' . $expectedTarget . '!', $actual );
}
public static function provideMakeRedirectContent() {
return [
[ new TitleValue( NS_MAIN, 'Hello' ), '#REDIRECT [[Hello]]', 'Hello' ],
[ new TitleValue( NS_TEMPLATE, 'Hello' ), '#REDIRECT [[Template:Hello]]', 'Template:Hello' ],
[ new TitleValue( NS_MAIN, 'Hello', 'section' ), '#REDIRECT [[Hello#section]]', 'Hello#section' ],
[ new TitleValue( NS_USER, 'John doe', 'section' ), '#REDIRECT [[User:John doe#section]]', 'User:John doe#section' ],
[ new TitleValue( NS_MEDIAWIKI, 'FOOBAR' ), '#REDIRECT [[MediaWiki:FOOBAR]]', 'MediaWiki:FOOBAR' ],
[ new TitleValue( NS_CATEGORY, 'Foo' ), '#REDIRECT [[:Category:Foo]]', 'Category:Foo' ],
[ new TitleValue( NS_MAIN, 'en:Foo' ), '#REDIRECT [[en:Foo]]', 'en:Foo' ],
[ new TitleValue( NS_MAIN, 'Foo', '', 'en' ), '#REDIRECT [[:en:Foo]]', 'en:Foo' ],
[
new TitleValue( NS_MAIN, 'Bar', 'fragment', 'google' ),
'#REDIRECT [[google:Bar#fragment]]',
'google:Bar#fragment'
],
];
}
}