Merge "Update docs/hooks.txt for ShowSearchHitTitle"
[mediawiki.git] / tests / phpunit / includes / logging / PageLangLogFormatterTest.php
blob2156bdb4abfa96537c4dce31036b4c39ed43e871
1 <?php
3 class PageLangLogFormatterTest extends LogFormatterTestCase {
5 protected function setUp() {
6 parent::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',
13 ] );
16 /**
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() {
22 return [
23 // Current format
26 'type' => 'pagelang',
27 'action' => 'pagelang',
28 'comment' => 'page lang comment',
29 'namespace' => NS_MAIN,
30 'title' => 'Page',
31 'params' => [
32 '4::oldlanguage' => 'en',
33 '5::newlanguage' => 'de[def]',
37 'text' => 'User changed the language of Page from English (en) to Deutsch (de) [default]',
38 'api' => [
39 'oldlanguage' => 'en',
40 'newlanguage' => 'de[def]'
47 /**
48 * @dataProvider providePageLangLogDatabaseRows
50 public function testPageLangLogDatabaseRows( $row, $extra ) {
51 $this->doTestLogFormatter( $row, $extra );