wiki.techinc.nl/tests/phpunit/includes/logging/ProtectLogFormatterTest.php
umherirrender 3964b4cc05 Migrate move protect log to new log system
Migrate the move protect log as first sub type of the protection log,
because it does not have complex log parameter, which needs some way of
handling/migration.
It also keeps the gerrit change smaller and hopefully makes review
easier.
The other sub types of the protection log will be migrated in a later
patch set.

This allows use of gender on Special:Log. Old message is kept for use
in IRC. A test was added to ensure an unchanged IRC message.

Bug: T47988
Change-Id: I57b3bd8a7dc823acdbb56520d2364f5542283373
2015-08-18 22:20:35 +00:00

63 lines
1.4 KiB
PHP

<?php
class ProtectLogFormatterTest extends LogFormatterTestCase {
/**
* Provide different rows from the logging table to test
* for backward compatibility.
* Do not change the existing data, just add a new database row
*/
public static function provideMoveProtLogDatabaseRows() {
return array(
// Current format
array(
array(
'type' => 'protect',
'action' => 'move_prot',
'comment' => 'Move comment',
'namespace' => NS_MAIN,
'title' => 'NewPage',
'params' => array(
'4::oldtitle' => 'OldPage',
),
),
array(
'text' => 'User moved protection settings from OldPage to NewPage',
'api' => array(
'oldtitle_ns' => 0,
'oldtitle_title' => 'OldPage',
),
),
),
// Legacy format
array(
array(
'type' => 'protect',
'action' => 'move_prot',
'comment' => 'Move comment',
'namespace' => NS_MAIN,
'title' => 'NewPage',
'params' => array(
'OldPage',
),
),
array(
'legacy' => true,
'text' => 'User moved protection settings from OldPage to NewPage',
'api' => array(
'oldtitle_ns' => 0,
'oldtitle_title' => 'OldPage',
),
),
),
);
}
/**
* @dataProvider provideMoveProtLogDatabaseRows
*/
public function testMoveProtLogDatabaseRows( $row, $extra ) {
$this->doTestLogFormatter( $row, $extra );
}
}