MediaWiki REL1_33
MergeLogFormatterTest.php
Go to the documentation of this file.
1<?php
2
7
13 public static function provideMergeLogDatabaseRows() {
14 return [
15 // Current format
16 [
17 [
18 'type' => 'merge',
19 'action' => 'merge',
20 'comment' => 'Merge comment',
21 'namespace' => NS_MAIN,
22 'title' => 'OldPage',
23 'params' => [
24 '4::dest' => 'NewPage',
25 '5::mergepoint' => '20140804160710',
26 ],
27 ],
28 [
29 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
30 'api' => [
31 'dest_ns' => 0,
32 'dest_title' => 'NewPage',
33 'mergepoint' => '2014-08-04T16:07:10Z',
34 ],
35 ],
36 ],
37
38 // Legacy format
39 [
40 [
41 'type' => 'merge',
42 'action' => 'merge',
43 'comment' => 'merge comment',
44 'namespace' => NS_MAIN,
45 'title' => 'OldPage',
46 'params' => [
47 'NewPage',
48 '20140804160710',
49 ],
50 ],
51 [
52 'legacy' => true,
53 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)',
54 'api' => [
55 'dest_ns' => 0,
56 'dest_title' => 'NewPage',
57 'mergepoint' => '2014-08-04T16:07:10Z',
58 ],
59 ],
60 ],
61 ];
62 }
63
67 public function testMergeLogDatabaseRows( $row, $extra ) {
68 $this->doTestLogFormatter( $row, $extra );
69 }
70}
doTestLogFormatter( $row, $extra)
testMergeLogDatabaseRows( $row, $extra)
provideMergeLogDatabaseRows
static provideMergeLogDatabaseRows()
Provide different rows from the logging table to test for backward compatibility.
const NS_MAIN
Definition Defines.php:73