diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /tests/phpunit/includes/logging/MergeLogFormatterTest.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'tests/phpunit/includes/logging/MergeLogFormatterTest.php')
-rw-r--r-- | tests/phpunit/includes/logging/MergeLogFormatterTest.php | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/phpunit/includes/logging/MergeLogFormatterTest.php b/tests/phpunit/includes/logging/MergeLogFormatterTest.php new file mode 100644 index 00000000..2ff0ddf5 --- /dev/null +++ b/tests/phpunit/includes/logging/MergeLogFormatterTest.php @@ -0,0 +1,67 @@ +<?php + +class MergeLogFormatterTest 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 provideMergeLogDatabaseRows() { + return array( + // Current format + array( + array( + 'type' => 'merge', + 'action' => 'merge', + 'comment' => 'Merge comment', + 'namespace' => NS_MAIN, + 'title' => 'OldPage', + 'params' => array( + '4::dest' => 'NewPage', + '5::mergepoint' => '20140804160710', + ), + ), + array( + 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)', + 'api' => array( + 'dest_ns' => 0, + 'dest_title' => 'NewPage', + 'mergepoint' => '2014-08-04T16:07:10Z', + ), + ), + ), + + // Legacy format + array( + array( + 'type' => 'merge', + 'action' => 'merge', + 'comment' => 'merge comment', + 'namespace' => NS_MAIN, + 'title' => 'OldPage', + 'params' => array( + 'NewPage', + '20140804160710', + ), + ), + array( + 'legacy' => true, + 'text' => 'User merged OldPage into NewPage (revisions up to 16:07, 4 August 2014)', + 'api' => array( + 'dest_ns' => 0, + 'dest_title' => 'NewPage', + 'mergepoint' => '2014-08-04T16:07:10Z', + ), + ), + ), + ); + } + + /** + * @dataProvider provideMergeLogDatabaseRows + */ + public function testMergeLogDatabaseRows( $row, $extra ) { + $this->doTestLogFormatter( $row, $extra ); + } +} |