MediaWiki  1.30.2
PatrolLogFormatterTest.php
Go to the documentation of this file.
1 <?php
2 
4 
10  public static function providePatrolLogDatabaseRows() {
11  return [
12  // Current format
13  [
14  [
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,
24  ],
25  ],
26  [
27  'text' => 'User marked revision 2 of page Page patrolled',
28  'api' => [
29  'curid' => 2,
30  'previd' => 1,
31  'auto' => false,
32  ],
33  ],
34  ],
35 
36  // Current format - autopatrol
37  [
38  [
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,
48  ],
49  ],
50  [
51  'text' => 'User automatically marked revision 2 of page Page patrolled',
52  'api' => [
53  'curid' => 2,
54  'previd' => 1,
55  'auto' => true,
56  ],
57  ],
58  ],
59 
60  // Legacy format
61  [
62  [
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',
72  ],
73  ],
74  [
75  'legacy' => true,
76  'text' => 'User marked revision 2 of page Page patrolled',
77  'api' => [
78  'curid' => 2,
79  'previd' => 1,
80  'auto' => false,
81  ],
82  ],
83  ],
84 
85  // Legacy format - autopatrol
86  [
87  [
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',
97  ],
98  ],
99  [
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,
106  ],
107  ],
108  ],
109  ];
110  }
111 
115  public function testPatrolLogDatabaseRows( $row, $extra ) {
116  $this->doTestLogFormatter( $row, $extra );
117  }
118 }
PatrolLogFormatterTest\providePatrolLogDatabaseRows
static providePatrolLogDatabaseRows()
Provide different rows from the logging table to test for backward compatibility.
Definition: PatrolLogFormatterTest.php:10
PatrolLogFormatterTest
Definition: PatrolLogFormatterTest.php:3
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
NS_MAIN
const NS_MAIN
Definition: Defines.php:65
LogFormatterTestCase
Definition: LogFormatterTestCase.php:6
PatrolLogFormatterTest\testPatrolLogDatabaseRows
testPatrolLogDatabaseRows( $row, $extra)
providePatrolLogDatabaseRows
Definition: PatrolLogFormatterTest.php:115
LogFormatterTestCase\doTestLogFormatter
doTestLogFormatter( $row, $extra)
Definition: LogFormatterTestCase.php:8