3 class MoveLogFormatterTest
extends LogFormatterTestCase
{
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
10 public static function provideMoveLogDatabaseRows() {
12 // Current format - with redirect
17 'comment' => 'move comment with redirect',
18 'namespace' => NS_MAIN
,
21 '4::target' => 'NewPage',
26 'text' => 'User moved page OldPage to NewPage',
29 'target_title' => 'NewPage',
30 'suppressredirect' => false,
35 // Current format - without redirect
40 'comment' => 'move comment',
41 'namespace' => NS_MAIN
,
44 '4::target' => 'NewPage',
49 'text' => 'User moved page OldPage to NewPage without leaving a redirect',
52 'target_title' => 'NewPage',
53 'suppressredirect' => true,
58 // legacy format - with redirect
63 'comment' => 'move comment',
64 'namespace' => NS_MAIN
,
73 'text' => 'User moved page OldPage to NewPage',
76 'target_title' => 'NewPage',
77 'suppressredirect' => false,
82 // legacy format - without redirect
87 'comment' => 'move comment',
88 'namespace' => NS_MAIN
,
97 'text' => 'User moved page OldPage to NewPage without leaving a redirect',
100 'target_title' => 'NewPage',
101 'suppressredirect' => true,
106 // old format without flag for redirect suppression
111 'comment' => 'move comment',
112 'namespace' => NS_MAIN
,
113 'title' => 'OldPage',
120 'text' => 'User moved page OldPage to NewPage',
123 'target_title' => 'NewPage',
124 'suppressredirect' => false,
132 * @dataProvider provideMoveLogDatabaseRows
134 public function testMoveLogDatabaseRows( $row, $extra ) {
135 $this->doTestLogFormatter( $row, $extra );
139 * Provide different rows from the logging table to test
140 * for backward compatibility.
141 * Do not change the existing data, just add a new database row
143 public static function provideMoveRedirLogDatabaseRows() {
145 // Current format - with redirect
149 'action' => 'move_redir',
150 'comment' => 'move comment with redirect',
151 'namespace' => NS_MAIN
,
152 'title' => 'OldPage',
154 '4::target' => 'NewPage',
159 'text' => 'User moved page OldPage to NewPage over redirect',
162 'target_title' => 'NewPage',
163 'suppressredirect' => false,
168 // Current format - without redirect
172 'action' => 'move_redir',
173 'comment' => 'move comment',
174 'namespace' => NS_MAIN
,
175 'title' => 'OldPage',
177 '4::target' => 'NewPage',
182 'text' => 'User moved page OldPage to NewPage over a redirect without leaving a redirect',
185 'target_title' => 'NewPage',
186 'suppressredirect' => true,
191 // legacy format - with redirect
195 'action' => 'move_redir',
196 'comment' => 'move comment',
197 'namespace' => NS_MAIN
,
198 'title' => 'OldPage',
206 'text' => 'User moved page OldPage to NewPage over redirect',
209 'target_title' => 'NewPage',
210 'suppressredirect' => false,
215 // legacy format - without redirect
219 'action' => 'move_redir',
220 'comment' => 'move comment',
221 'namespace' => NS_MAIN
,
222 'title' => 'OldPage',
230 'text' => 'User moved page OldPage to NewPage over a redirect without leaving a redirect',
233 'target_title' => 'NewPage',
234 'suppressredirect' => true,
239 // old format without flag for redirect suppression
243 'action' => 'move_redir',
244 'comment' => 'move comment',
245 'namespace' => NS_MAIN
,
246 'title' => 'OldPage',
253 'text' => 'User moved page OldPage to NewPage over redirect',
256 'target_title' => 'NewPage',
257 'suppressredirect' => false,
265 * @dataProvider provideMoveRedirLogDatabaseRows
267 public function testMoveRedirLogDatabaseRows( $row, $extra ) {
268 $this->doTestLogFormatter( $row, $extra );