3 class DeleteLogFormatterTest
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 provideDeleteLogDatabaseRows() {
17 'comment' => 'delete comment',
18 'namespace' => NS_MAIN
,
23 'text' => 'User deleted page Page',
33 'comment' => 'delete comment',
34 'namespace' => NS_MAIN
,
40 'text' => 'User deleted page Page',
48 * @dataProvider provideDeleteLogDatabaseRows
50 public function testDeleteLogDatabaseRows( $row, $extra ) {
51 $this->doTestLogFormatter( $row, $extra );
55 * Provide different rows from the logging table to test
56 * for backward compatibility.
57 * Do not change the existing data, just add a new database row
59 public static function provideRestoreLogDatabaseRows() {
65 'action' => 'restore',
66 'comment' => 'delete comment',
67 'namespace' => NS_MAIN
,
77 'text' => 'User restored page Page (2 revisions and 1 file)',
87 // Legacy format without counts
91 'action' => 'restore',
92 'comment' => 'delete comment',
93 'namespace' => NS_MAIN
,
98 'text' => 'User restored page Page',
107 'action' => 'restore',
108 'comment' => 'delete comment',
109 'namespace' => NS_MAIN
,
115 'text' => 'User restored page Page',
123 * @dataProvider provideRestoreLogDatabaseRows
125 public function testRestoreLogDatabaseRows( $row, $extra ) {
126 $this->doTestLogFormatter( $row, $extra );
130 * Provide different rows from the logging table to test
131 * for backward compatibility.
132 * Do not change the existing data, just add a new database row
134 public static function provideRevisionLogDatabaseRows() {
140 'action' => 'revision',
141 'comment' => 'delete comment',
142 'namespace' => NS_MAIN
,
145 '4::type' => 'archive',
146 '5::ids' => [ '1', '3', '4' ],
152 'text' => 'User changed visibility of 3 revisions on page Page: edit summary '
153 . 'hidden and content unhidden',
156 'ids' => [ '1', '3', '4' ],
162 'restricted' => false,
169 'restricted' => false,
179 'action' => 'revision',
180 'comment' => 'delete comment',
181 'namespace' => NS_MAIN
,
192 'text' => 'User changed visibility of 3 revisions on page Page: edit summary '
193 . 'hidden and content unhidden',
196 'ids' => [ '1', '3', '4' ],
202 'restricted' => false,
209 'restricted' => false,
218 * @dataProvider provideRevisionLogDatabaseRows
220 public function testRevisionLogDatabaseRows( $row, $extra ) {
221 $this->doTestLogFormatter( $row, $extra );
225 * Provide different rows from the logging table to test
226 * for backward compatibility.
227 * Do not change the existing data, just add a new database row
229 public static function provideEventLogDatabaseRows() {
236 'comment' => 'delete comment',
237 'namespace' => NS_MAIN
,
240 '4::ids' => [ '1', '3', '4' ],
246 'text' => 'User changed visibility of 3 log events on Page: edit summary hidden '
247 . 'and content unhidden',
250 'ids' => [ '1', '3', '4' ],
256 'restricted' => false,
263 'restricted' => false,
274 'comment' => 'delete comment',
275 'namespace' => NS_MAIN
,
285 'text' => 'User changed visibility of 3 log events on Page: edit summary hidden '
286 . 'and content unhidden',
289 'ids' => [ '1', '3', '4' ],
295 'restricted' => false,
302 'restricted' => false,
311 * @dataProvider provideEventLogDatabaseRows
313 public function testEventLogDatabaseRows( $row, $extra ) {
314 $this->doTestLogFormatter( $row, $extra );
318 * Provide different rows from the logging table to test
319 * for backward compatibility.
320 * Do not change the existing data, just add a new database row
322 public static function provideSuppressRevisionLogDatabaseRows() {
327 'type' => 'suppress',
328 'action' => 'revision',
329 'comment' => 'Suppress comment',
330 'namespace' => NS_MAIN
,
333 '4::type' => 'archive',
334 '5::ids' => [ '1', '3', '4' ],
340 'text' => 'User secretly changed visibility of 3 revisions on page Page: edit '
341 . 'summary hidden, content unhidden and applied restrictions to administrators',
344 'ids' => [ '1', '3', '4' ],
350 'restricted' => false,
357 'restricted' => true,
366 'type' => 'suppress',
367 'action' => 'revision',
368 'comment' => 'Suppress comment',
369 'namespace' => NS_MAIN
,
380 'text' => 'User secretly changed visibility of 3 revisions on page Page: edit '
381 . 'summary hidden, content unhidden and applied restrictions to administrators',
384 'ids' => [ '1', '3', '4' ],
390 'restricted' => false,
397 'restricted' => true,
406 * @dataProvider provideSuppressRevisionLogDatabaseRows
408 public function testSuppressRevisionLogDatabaseRows( $row, $extra ) {
409 $this->doTestLogFormatter( $row, $extra );
413 * Provide different rows from the logging table to test
414 * for backward compatibility.
415 * Do not change the existing data, just add a new database row
417 public static function provideSuppressEventLogDatabaseRows() {
422 'type' => 'suppress',
424 'comment' => 'Suppress comment',
425 'namespace' => NS_MAIN
,
428 '4::ids' => [ '1', '3', '4' ],
434 'text' => 'User secretly changed visibility of 3 log events on Page: edit '
435 . 'summary hidden, content unhidden and applied restrictions to administrators',
438 'ids' => [ '1', '3', '4' ],
444 'restricted' => false,
451 'restricted' => true,
460 'type' => 'suppress',
462 'comment' => 'Suppress comment',
463 'namespace' => NS_MAIN
,
473 'text' => 'User secretly changed visibility of 3 log events on Page: edit '
474 . 'summary hidden, content unhidden and applied restrictions to administrators',
477 'ids' => [ '1', '3', '4' ],
483 'restricted' => false,
490 'restricted' => true,
499 * @dataProvider provideSuppressEventLogDatabaseRows
501 public function testSuppressEventLogDatabaseRows( $row, $extra ) {
502 $this->doTestLogFormatter( $row, $extra );
506 * Provide different rows from the logging table to test
507 * for backward compatibility.
508 * Do not change the existing data, just add a new database row
510 public static function provideSuppressDeleteLogDatabaseRows() {
515 'type' => 'suppress',
516 'action' => 'delete',
517 'comment' => 'delete comment',
518 'namespace' => NS_MAIN
,
523 'text' => 'User suppressed page Page',
531 'type' => 'suppress',
532 'action' => 'delete',
533 'comment' => 'delete comment',
534 'namespace' => NS_MAIN
,
540 'text' => 'User suppressed page Page',
548 * @dataProvider provideSuppressDeleteLogDatabaseRows
550 public function testSuppressDeleteLogDatabaseRows( $row, $extra ) {
551 $this->doTestLogFormatter( $row, $extra );