Merge "Tweaked TempFSFile::bind() param type docs"
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / PageLangLogFormatterTest.php
1 <?php
2
3 class PageLangLogFormatterTest extends LogFormatterTestCase {
4
5 protected function setUp() {
6 parent::setUp();
7
8 // Disable cldr extension
9 $this->setMwGlobals( 'wgHooks', array() );
10 // Register LogHandler, see $wgPageLanguageUseDB in Setup.php
11 $this->mergeMwGlobalArrayValue( 'wgLogActionsHandlers', array(
12 'pagelang/pagelang' => 'PageLangLogFormatter',
13 ) );
14 }
15
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
20 */
21 public static function providePageLangLogDatabaseRows() {
22 return array(
23 // Current format
24 array(
25 array(
26 'type' => 'pagelang',
27 'action' => 'pagelang',
28 'comment' => 'page lang comment',
29 'namespace' => NS_MAIN,
30 'title' => 'Page',
31 'params' => array(
32 '4::oldlanguage' => 'en',
33 '5::newlanguage' => 'de[def]',
34 ),
35 ),
36 array(
37 'text' => 'User changed page language for Page from English (en) to Deutsch (de) [default].',
38 'api' => array(
39 'oldlanguage' => 'en',
40 'newlanguage' => 'de[def]'
41 ),
42 ),
43 ),
44 );
45 }
46
47 /**
48 * @dataProvider providePageLangLogDatabaseRows
49 */
50 public function testPageLangLogDatabaseRows( $row, $extra ) {
51 $this->doTestLogFormatter( $row, $extra );
52 }
53 }