Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / includes / logging / MergeLogFormatterTest.php
blob694efb7268ef723f7b474caf76267341260de1a2
1 <?php
3 /**
4 * @covers \MergeLogFormatter
5 */
6 class MergeLogFormatterTest extends LogFormatterTestCase {
8 /**
9 * Provide different rows from the logging table to test
10 * for backward compatibility.
11 * Do not change the existing data, just add a new database row
13 public static function provideMergeLogDatabaseRows() {
14 return [
15 // Current format with a revid
18 'type' => 'merge',
19 'action' => 'merge',
20 'comment' => 'Merge comment',
21 'namespace' => NS_MAIN,
22 'title' => 'OldPage',
23 'params' => [
24 '4::dest' => 'NewPage',
25 '5::mergepoint' => '20140804160710',
26 '6::mergerevid' => '1234'
30 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
31 'api' => [
32 'mergerevid' => '1234',
33 'dest_ns' => 0,
34 'dest_title' => 'NewPage',
35 'mergepoint' => '2014-08-04T16:07:10Z',
39 // Same format without a revid
42 'type' => 'merge',
43 'action' => 'merge',
44 'comment' => 'Merge comment',
45 'namespace' => NS_MAIN,
46 'title' => 'OldPage',
47 'params' => [
48 '4::dest' => 'NewPage',
49 '5::mergepoint' => '20140804160710',
53 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
54 'api' => [
55 'dest_ns' => 0,
56 'dest_title' => 'NewPage',
57 'mergepoint' => '2014-08-04T16:07:10Z',
62 // Legacy format
65 'type' => 'merge',
66 'action' => 'merge',
67 'comment' => 'merge comment',
68 'namespace' => NS_MAIN,
69 'title' => 'OldPage',
70 'params' => [
71 'NewPage',
72 '20140804160710',
76 'legacy' => true,
77 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
78 'api' => [
79 'dest_ns' => 0,
80 'dest_title' => 'NewPage',
81 'mergepoint' => '2014-08-04T16:07:10Z',
88 /**
89 * @dataProvider provideMergeLogDatabaseRows
91 public function testMergeLogDatabaseRows( $row, $extra ) {
92 $this->doTestLogFormatter( $row, $extra );