Merge "Add hook to allow lazy loading of import sources"
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / ProtectLogFormatterTest.php
1 <?php
2
3 class ProtectLogFormatterTest extends LogFormatterTestCase {
4
5 /**
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
9 */
10 public static function provideMoveProtLogDatabaseRows() {
11 return array(
12 // Current format
13 array(
14 array(
15 'type' => 'protect',
16 'action' => 'move_prot',
17 'comment' => 'Move comment',
18 'namespace' => NS_MAIN,
19 'title' => 'NewPage',
20 'params' => array(
21 '4::oldtitle' => 'OldPage',
22 ),
23 ),
24 array(
25 'text' => 'User moved protection settings from OldPage to NewPage',
26 'api' => array(
27 'oldtitle_ns' => 0,
28 'oldtitle_title' => 'OldPage',
29 ),
30 ),
31 ),
32
33 // Legacy format
34 array(
35 array(
36 'type' => 'protect',
37 'action' => 'move_prot',
38 'comment' => 'Move comment',
39 'namespace' => NS_MAIN,
40 'title' => 'NewPage',
41 'params' => array(
42 'OldPage',
43 ),
44 ),
45 array(
46 'legacy' => true,
47 'text' => 'User moved protection settings from OldPage to NewPage',
48 'api' => array(
49 'oldtitle_ns' => 0,
50 'oldtitle_title' => 'OldPage',
51 ),
52 ),
53 ),
54 );
55 }
56
57 /**
58 * @dataProvider provideMoveProtLogDatabaseRows
59 */
60 public function testMoveProtLogDatabaseRows( $row, $extra ) {
61 $this->doTestLogFormatter( $row, $extra );
62 }
63 }