4 * @covers DeleteLogFormatter
6 class DeleteLogFormatterTest
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 provideDeleteLogDatabaseRows() {
20 'comment' => 'delete comment',
21 'namespace' => NS_MAIN
,
26 'text' => 'User deleted page Page',
36 'comment' => 'delete comment',
37 'namespace' => NS_MAIN
,
43 'text' => 'User deleted page Page',
51 * @dataProvider provideDeleteLogDatabaseRows
53 public function testDeleteLogDatabaseRows( $row, $extra ) {
54 $this->doTestLogFormatter( $row, $extra );
58 * Provide different rows from the logging table to test
59 * for backward compatibility.
60 * Do not change the existing data, just add a new database row
62 public static function provideRestoreLogDatabaseRows() {
68 'action' => 'restore',
69 'comment' => 'delete comment',
70 'namespace' => NS_MAIN
,
80 'text' => 'User restored page Page (2 revisions and 1 file)',
90 // Legacy format without counts
94 'action' => 'restore',
95 'comment' => 'delete comment',
96 'namespace' => NS_MAIN
,
101 'text' => 'User restored page Page',
110 'action' => 'restore',
111 'comment' => 'delete comment',
112 'namespace' => NS_MAIN
,
118 'text' => 'User restored page Page',
126 * @dataProvider provideRestoreLogDatabaseRows
128 public function testRestoreLogDatabaseRows( $row, $extra ) {
129 $this->doTestLogFormatter( $row, $extra );
133 * Provide different rows from the logging table to test
134 * for backward compatibility.
135 * Do not change the existing data, just add a new database row
137 public static function provideRevisionLogDatabaseRows() {
143 'action' => 'revision',
144 'comment' => 'delete comment',
145 'namespace' => NS_MAIN
,
148 '4::type' => 'archive',
149 '5::ids' => [ '1', '3', '4' ],
155 'text' => 'User changed visibility of 3 revisions on page Page: edit summary '
156 . 'hidden and content unhidden',
159 'ids' => [ '1', '3', '4' ],
165 'restricted' => false,
172 'restricted' => false,
182 'action' => 'revision',
183 'comment' => 'delete comment',
184 'namespace' => NS_MAIN
,
195 'text' => 'User changed visibility of 3 revisions on page Page: edit summary '
196 . 'hidden and content unhidden',
199 'ids' => [ '1', '3', '4' ],
205 'restricted' => false,
212 'restricted' => false,
221 * @dataProvider provideRevisionLogDatabaseRows
223 public function testRevisionLogDatabaseRows( $row, $extra ) {
224 $this->doTestLogFormatter( $row, $extra );
228 * Provide different rows from the logging table to test
229 * for backward compatibility.
230 * Do not change the existing data, just add a new database row
232 public static function provideEventLogDatabaseRows() {
239 'comment' => 'delete comment',
240 'namespace' => NS_MAIN
,
243 '4::ids' => [ '1', '3', '4' ],
249 'text' => 'User changed visibility of 3 log events on Page: edit summary hidden '
250 . 'and content unhidden',
253 'ids' => [ '1', '3', '4' ],
259 'restricted' => false,
266 'restricted' => false,
277 'comment' => 'delete comment',
278 'namespace' => NS_MAIN
,
288 'text' => 'User changed visibility of 3 log events on Page: edit summary hidden '
289 . 'and content unhidden',
292 'ids' => [ '1', '3', '4' ],
298 'restricted' => false,
305 'restricted' => false,
314 * @dataProvider provideEventLogDatabaseRows
316 public function testEventLogDatabaseRows( $row, $extra ) {
317 $this->doTestLogFormatter( $row, $extra );
321 * Provide different rows from the logging table to test
322 * for backward compatibility.
323 * Do not change the existing data, just add a new database row
325 public static function provideSuppressRevisionLogDatabaseRows() {
330 'type' => 'suppress',
331 'action' => 'revision',
332 'comment' => 'Suppress comment',
333 'namespace' => NS_MAIN
,
336 '4::type' => 'archive',
337 '5::ids' => [ '1', '3', '4' ],
343 'text' => 'User secretly changed visibility of 3 revisions on page Page: edit '
344 . 'summary hidden, content unhidden and applied restrictions to administrators',
347 'ids' => [ '1', '3', '4' ],
353 'restricted' => false,
360 'restricted' => true,
369 'type' => 'suppress',
370 'action' => 'revision',
371 'comment' => 'Suppress comment',
372 'namespace' => NS_MAIN
,
383 'text' => 'User secretly changed visibility of 3 revisions on page Page: edit '
384 . 'summary hidden, content unhidden and applied restrictions to administrators',
387 'ids' => [ '1', '3', '4' ],
393 'restricted' => false,
400 'restricted' => true,
409 * @dataProvider provideSuppressRevisionLogDatabaseRows
411 public function testSuppressRevisionLogDatabaseRows( $row, $extra ) {
412 $this->doTestLogFormatter( $row, $extra );
416 * Provide different rows from the logging table to test
417 * for backward compatibility.
418 * Do not change the existing data, just add a new database row
420 public static function provideSuppressEventLogDatabaseRows() {
425 'type' => 'suppress',
427 'comment' => 'Suppress comment',
428 'namespace' => NS_MAIN
,
431 '4::ids' => [ '1', '3', '4' ],
437 'text' => 'User secretly changed visibility of 3 log events on Page: edit '
438 . 'summary hidden, content unhidden and applied restrictions to administrators',
441 'ids' => [ '1', '3', '4' ],
447 'restricted' => false,
454 'restricted' => true,
463 'type' => 'suppress',
465 'comment' => 'Suppress comment',
466 'namespace' => NS_MAIN
,
476 'text' => 'User secretly changed visibility of 3 log events on Page: edit '
477 . 'summary hidden, content unhidden and applied restrictions to administrators',
480 'ids' => [ '1', '3', '4' ],
486 'restricted' => false,
493 'restricted' => true,
502 * @dataProvider provideSuppressEventLogDatabaseRows
504 public function testSuppressEventLogDatabaseRows( $row, $extra ) {
505 $this->doTestLogFormatter( $row, $extra );
509 * Provide different rows from the logging table to test
510 * for backward compatibility.
511 * Do not change the existing data, just add a new database row
513 public static function provideSuppressDeleteLogDatabaseRows() {
518 'type' => 'suppress',
519 'action' => 'delete',
520 'comment' => 'delete comment',
521 'namespace' => NS_MAIN
,
526 'text' => 'User suppressed page Page',
534 'type' => 'suppress',
535 'action' => 'delete',
536 'comment' => 'delete comment',
537 'namespace' => NS_MAIN
,
543 'text' => 'User suppressed page Page',
551 * @dataProvider provideSuppressDeleteLogDatabaseRows
553 public function testSuppressDeleteLogDatabaseRows( $row, $extra ) {
554 $this->doTestLogFormatter( $row, $extra );