4 * @covers MoveLogFormatter
6 class MoveLogFormatterTest
extends LogFormatterTestCase
{
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 provideMoveLogDatabaseRows() {
15 // Current format - with redirect
20 'comment' => 'move comment with redirect',
21 'namespace' => NS_MAIN
,
24 '4::target' => 'NewPage',
29 'text' => 'User moved page OldPage to NewPage',
32 'target_title' => 'NewPage',
33 'suppressredirect' => false,
38 // Current format - without redirect
43 'comment' => 'move comment',
44 'namespace' => NS_MAIN
,
47 '4::target' => 'NewPage',
52 'text' => 'User moved page OldPage to NewPage without leaving a redirect',
55 'target_title' => 'NewPage',
56 'suppressredirect' => true,
61 // legacy format - with redirect
66 'comment' => 'move comment',
67 'namespace' => NS_MAIN
,
76 'text' => 'User moved page OldPage to NewPage',
79 'target_title' => 'NewPage',
80 'suppressredirect' => false,
85 // legacy format - without redirect
90 'comment' => 'move comment',
91 'namespace' => NS_MAIN
,
100 'text' => 'User moved page OldPage to NewPage without leaving a redirect',
103 'target_title' => 'NewPage',
104 'suppressredirect' => true,
109 // old format without flag for redirect suppression
114 'comment' => 'move comment',
115 'namespace' => NS_MAIN
,
116 'title' => 'OldPage',
123 'text' => 'User moved page OldPage to NewPage',
126 'target_title' => 'NewPage',
127 'suppressredirect' => false,
135 * @dataProvider provideMoveLogDatabaseRows
137 public function testMoveLogDatabaseRows( $row, $extra ) {
138 $this->doTestLogFormatter( $row, $extra );
142 * Provide different rows from the logging table to test
143 * for backward compatibility.
144 * Do not change the existing data, just add a new database row
146 public static function provideMoveRedirLogDatabaseRows() {
148 // Current format - with redirect
152 'action' => 'move_redir',
153 'comment' => 'move comment with redirect',
154 'namespace' => NS_MAIN
,
155 'title' => 'OldPage',
157 '4::target' => 'NewPage',
162 'text' => 'User moved page OldPage to NewPage over redirect',
165 'target_title' => 'NewPage',
166 'suppressredirect' => false,
171 // Current format - without redirect
175 'action' => 'move_redir',
176 'comment' => 'move comment',
177 'namespace' => NS_MAIN
,
178 'title' => 'OldPage',
180 '4::target' => 'NewPage',
185 'text' => 'User moved page OldPage to NewPage over a redirect without leaving a redirect',
188 'target_title' => 'NewPage',
189 'suppressredirect' => true,
194 // legacy format - with redirect
198 'action' => 'move_redir',
199 'comment' => 'move comment',
200 'namespace' => NS_MAIN
,
201 'title' => 'OldPage',
209 'text' => 'User moved page OldPage to NewPage over redirect',
212 'target_title' => 'NewPage',
213 'suppressredirect' => false,
218 // legacy format - without redirect
222 'action' => 'move_redir',
223 'comment' => 'move comment',
224 'namespace' => NS_MAIN
,
225 'title' => 'OldPage',
233 'text' => 'User moved page OldPage to NewPage over a redirect without leaving a redirect',
236 'target_title' => 'NewPage',
237 'suppressredirect' => true,
242 // old format without flag for redirect suppression
246 'action' => 'move_redir',
247 'comment' => 'move comment',
248 'namespace' => NS_MAIN
,
249 'title' => 'OldPage',
256 'text' => 'User moved page OldPage to NewPage over redirect',
259 'target_title' => 'NewPage',
260 'suppressredirect' => false,
268 * @dataProvider provideMoveRedirLogDatabaseRows
270 public function testMoveRedirLogDatabaseRows( $row, $extra ) {
271 $this->doTestLogFormatter( $row, $extra );