3 use MediaWiki\MainConfigNames
;
4 use MediaWiki\MainConfigSchema
;
7 * @covers \PageLangLogFormatter
9 class PageLangLogFormatterTest
extends LogFormatterTestCase
{
11 protected function setUp(): void
{
14 // Clear all hooks to disable cldr extension
17 // Register LogHandler, see $wgPageLanguageUseDB in Setup.php
18 $this->overrideConfigValue(
19 MainConfigNames
::LogActionsHandlers
,
20 MainConfigSchema
::getDefaultValue( MainConfigNames
::LogActionsHandlers
) +
22 'pagelang/pagelang' => [
23 'class' => PageLangLogFormatter
::class,
33 * Provide different rows from the logging table to test
34 * for backward compatibility.
35 * Do not change the existing data, just add a new database row
37 public static function providePageLangLogDatabaseRows() {
43 'action' => 'pagelang',
44 'comment' => 'page lang comment',
45 'namespace' => NS_MAIN
,
48 '4::oldlanguage' => 'en',
49 '5::newlanguage' => 'de[def]',
53 'text' => 'User changed the language of Page from English (en) to Deutsch (de) [default]',
55 'oldlanguage' => 'en',
56 'newlanguage' => 'de[def]'
64 * @dataProvider providePageLangLogDatabaseRows
66 public function testPageLangLogDatabaseRows( $row, $extra ) {
67 $this->doTestLogFormatter( $row, $extra );