3 class PageLangLogFormatterTest
extends LogFormatterTestCase
{
5 protected function setUp() {
8 // Disable cldr extension
9 $this->setMwGlobals( 'wgHooks', [] );
10 // Register LogHandler, see $wgPageLanguageUseDB in Setup.php
11 $this->mergeMwGlobalArrayValue( 'wgLogActionsHandlers', [
12 'pagelang/pagelang' => 'PageLangLogFormatter',
17 * Provide different rows from the logging table to test
18 * for backward compatibility.
19 * Do not change the existing data, just add a new database row
21 public static function providePageLangLogDatabaseRows() {
27 'action' => 'pagelang',
28 'comment' => 'page lang comment',
29 'namespace' => NS_MAIN
,
32 '4::oldlanguage' => 'en',
33 '5::newlanguage' => 'de[def]',
37 'text' => 'User changed the language of Page from English (en) to Deutsch (de) [default]',
39 'oldlanguage' => 'en',
40 'newlanguage' => 'de[def]'
48 * @dataProvider providePageLangLogDatabaseRows
50 public function testPageLangLogDatabaseRows( $row, $extra ) {
51 $this->doTestLogFormatter( $row, $extra );