wiki.techinc.nl/tests/phpunit/includes/logging/MergeLogFormatterTest.php
umherirrender f087bcb620 Use assertSame in LogFormatterTestCase
Using assertSame also checks for internal types to be correct.

Needs the following fixes:
- MergeLogFormatterTest: Use correct array key order
- NewUsersLogFormatterTest: Input user id as integer
- PatrolLogFormatter: Ensure in LogFormatter that
  integer is not casted to float

Change-Id: I2cab5335d6654f6cda15fc4e9fbae2c1ca1b27ff
2015-06-06 20:55:03 +02:00

67 lines
1.5 KiB
PHP

<?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 );
}
}