Add @covers tags to logging tests
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / MergeLogFormatterTest.php
1 <?php
2
3 /**
4 * @covers MergeLogFormatter
5 */
6 class MergeLogFormatterTest extends LogFormatterTestCase {
7
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
12 */
13 public static function provideMergeLogDatabaseRows() {
14 return [
15 // Current format
16 [
17 [
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 ],
27 ],
28 [
29 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
30 'api' => [
31 'dest_ns' => 0,
32 'dest_title' => 'NewPage',
33 'mergepoint' => '2014-08-04T16:07:10Z',
34 ],
35 ],
36 ],
37
38 // Legacy format
39 [
40 [
41 'type' => 'merge',
42 'action' => 'merge',
43 'comment' => 'merge comment',
44 'namespace' => NS_MAIN,
45 'title' => 'OldPage',
46 'params' => [
47 'NewPage',
48 '20140804160710',
49 ],
50 ],
51 [
52 'legacy' => true,
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',
58 ],
59 ],
60 ],
61 ];
62 }
63
64 /**
65 * @dataProvider provideMergeLogDatabaseRows
66 */
67 public function testMergeLogDatabaseRows( $row, $extra ) {
68 $this->doTestLogFormatter( $row, $extra );
69 }
70 }