Merge "Added release notes for 'ContentHandler::runLegacyHooks' removal"
[mediawiki.git] / tests / phpunit / includes / logging / PatrolLogFormatterTest.php
blobb680454354855c32011800c2e8d37ce18439a5fe
1 <?php
3 class PatrolLogFormatterTest extends LogFormatterTestCase {
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 providePatrolLogDatabaseRows() {
11 return [
12 // Current format
15 'type' => 'patrol',
16 'action' => 'patrol',
17 'comment' => 'patrol comment',
18 'namespace' => NS_MAIN,
19 'title' => 'Page',
20 'params' => [
21 '4::curid' => 2,
22 '5::previd' => 1,
23 '6::auto' => 0,
27 'text' => 'User marked revision 2 of page Page patrolled',
28 'api' => [
29 'curid' => 2,
30 'previd' => 1,
31 'auto' => false,
36 // Current format - autopatrol
39 'type' => 'patrol',
40 'action' => 'patrol',
41 'comment' => 'patrol comment',
42 'namespace' => NS_MAIN,
43 'title' => 'Page',
44 'params' => [
45 '4::curid' => 2,
46 '5::previd' => 1,
47 '6::auto' => 1,
51 'text' => 'User automatically marked revision 2 of page Page patrolled',
52 'api' => [
53 'curid' => 2,
54 'previd' => 1,
55 'auto' => true,
60 // Legacy format
63 'type' => 'patrol',
64 'action' => 'patrol',
65 'comment' => 'patrol comment',
66 'namespace' => NS_MAIN,
67 'title' => 'Page',
68 'params' => [
69 '2',
70 '1',
71 '0',
75 'legacy' => true,
76 'text' => 'User marked revision 2 of page Page patrolled',
77 'api' => [
78 'curid' => 2,
79 'previd' => 1,
80 'auto' => false,
85 // Legacy format - autopatrol
88 'type' => 'patrol',
89 'action' => 'patrol',
90 'comment' => 'patrol comment',
91 'namespace' => NS_MAIN,
92 'title' => 'Page',
93 'params' => [
94 '2',
95 '1',
96 '1',
100 'legacy' => true,
101 'text' => 'User automatically marked revision 2 of page Page patrolled',
102 'api' => [
103 'curid' => 2,
104 'previd' => 1,
105 'auto' => true,
113 * @dataProvider providePatrolLogDatabaseRows
115 public function testPatrolLogDatabaseRows( $row, $extra ) {
116 $this->doTestLogFormatter( $row, $extra );