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