Merge "Accessor to get EditPage parent revision ID"
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / MergeLogFormatterTest.php
1 <?php
2
3 class MergeLogFormatterTest extends LogFormatterTestCase {
4
5 /**
6 * Provide different rows from the logging table to test
7 * for backward compatibility.
8 * Do not change the existing data, just add a new database row
9 */
10 public static function provideMergeLogDatabaseRows() {
11 return array(
12 // Current format
13 array(
14 array(
15 'type' => 'merge',
16 'action' => 'merge',
17 'comment' => 'Merge comment',
18 'namespace' => NS_MAIN,
19 'title' => 'OldPage',
20 'params' => array(
21 '4::dest' => 'NewPage',
22 '5::mergepoint' => '20140804160710',
23 ),
24 ),
25 array(
26 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
27 'api' => array(
28 'dest_ns' => 0,
29 'dest_title' => 'NewPage',
30 'mergepoint' => '2014-08-04T16:07:10Z',
31 ),
32 ),
33 ),
34
35 // Legacy format
36 array(
37 array(
38 'type' => 'merge',
39 'action' => 'merge',
40 'comment' => 'merge comment',
41 'namespace' => NS_MAIN,
42 'title' => 'OldPage',
43 'params' => array(
44 'NewPage',
45 '20140804160710',
46 ),
47 ),
48 array(
49 'legacy' => true,
50 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
51 'api' => array(
52 'dest_ns' => 0,
53 'dest_title' => 'NewPage',
54 'mergepoint' => '2014-08-04T16:07:10Z',
55 ),
56 ),
57 ),
58 );
59 }
60
61 /**
62 * @dataProvider provideMergeLogDatabaseRows
63 */
64 public function testMergeLogDatabaseRows( $row, $extra ) {
65 $this->doTestLogFormatter( $row, $extra );
66 }
67 }