Merge "Drop cache interwiki"
[mediawiki.git] / tests / phpunit / includes / logging / PatrolLogFormatterTest.php
blob5c0137b2abaad7e7cb71499977a297d7ed46896b
1 <?php
3 /**
4 * @covers \PatrolLogFormatter
5 */
6 class PatrolLogFormatterTest 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 providePatrolLogDatabaseRows() {
14 return [
15 // Current format
18 'type' => 'patrol',
19 'action' => 'patrol',
20 'comment' => 'patrol comment',
21 'namespace' => NS_MAIN,
22 'title' => 'Page',
23 'params' => [
24 '4::curid' => 2,
25 '5::previd' => 1,
26 '6::auto' => 0,
30 'text' => 'User marked revision 2 of page Page patrolled',
31 'api' => [
32 'curid' => 2,
33 'previd' => 1,
34 'auto' => false,
39 // Current format - autopatrol
42 'type' => 'patrol',
43 'action' => 'patrol',
44 'comment' => 'patrol comment',
45 'namespace' => NS_MAIN,
46 'title' => 'Page',
47 'params' => [
48 '4::curid' => 2,
49 '5::previd' => 1,
50 '6::auto' => 1,
54 'text' => 'User automatically marked revision 2 of page Page patrolled',
55 'api' => [
56 'curid' => 2,
57 'previd' => 1,
58 'auto' => true,
63 // Legacy format
66 'type' => 'patrol',
67 'action' => 'patrol',
68 'comment' => 'patrol comment',
69 'namespace' => NS_MAIN,
70 'title' => 'Page',
71 'params' => [
72 '2',
73 '1',
74 '0',
78 'legacy' => true,
79 'text' => 'User marked revision 2 of page Page patrolled',
80 'api' => [
81 'curid' => 2,
82 'previd' => 1,
83 'auto' => false,
88 // Legacy format - autopatrol
91 'type' => 'patrol',
92 'action' => 'patrol',
93 'comment' => 'patrol comment',
94 'namespace' => NS_MAIN,
95 'title' => 'Page',
96 'params' => [
97 '2',
98 '1',
99 '1',
103 'legacy' => true,
104 'text' => 'User automatically marked revision 2 of page Page patrolled',
105 'api' => [
106 'curid' => 2,
107 'previd' => 1,
108 'auto' => true,
116 * @dataProvider providePatrolLogDatabaseRows
118 public function testPatrolLogDatabaseRows( $row, $extra ) {
119 $this->doTestLogFormatter( $row, $extra );