4 * @covers \UploadLogFormatter
6 class UploadLogFormatterTest
extends LogFormatterTestCase
{
9 * Provide different rows from the logging table to test
10 * for backward compatibility.
11 * Do not change the existing data, just add a new database row
13 public static function provideUploadLogDatabaseRows() {
20 'comment' => 'upload comment',
21 'namespace' => NS_FILE
,
22 'title' => 'File.png',
25 'img_timestamp' => '20150101000000',
29 'text' => 'User uploaded File:File.png',
32 'img_timestamp' => '2015-01-01T00:00:00Z',
37 // Old format without params
42 'comment' => 'upload comment',
43 'namespace' => NS_FILE
,
44 'title' => 'File.png',
48 'text' => 'User uploaded File:File.png',
56 * @dataProvider provideUploadLogDatabaseRows
58 public function testUploadLogDatabaseRows( $row, $extra ) {
59 $this->doTestLogFormatter( $row, $extra );
63 * Provide different rows from the logging table to test
64 * for backward compatibility.
65 * Do not change the existing data, just add a new database row
67 public static function provideOverwriteLogDatabaseRows() {
73 'action' => 'overwrite',
74 'comment' => 'upload comment',
75 'namespace' => NS_FILE
,
76 'title' => 'File.png',
79 'img_timestamp' => '20150101000000',
83 'text' => 'User uploaded a new version of File:File.png',
86 'img_timestamp' => '2015-01-01T00:00:00Z',
91 // Old format without params
95 'action' => 'overwrite',
96 'comment' => 'upload comment',
97 'namespace' => NS_FILE
,
98 'title' => 'File.png',
102 'text' => 'User uploaded a new version of File:File.png',
110 * @dataProvider provideOverwriteLogDatabaseRows
112 public function testOverwriteLogDatabaseRows( $row, $extra ) {
113 $this->doTestLogFormatter( $row, $extra );
117 * Provide different rows from the logging table to test
118 * for backward compatibility.
119 * Do not change the existing data, just add a new database row
121 public static function provideRevertLogDatabaseRows() {
127 'action' => 'revert',
128 'comment' => 'upload comment',
129 'namespace' => NS_FILE
,
130 'title' => 'File.png',
132 'img_sha1' => 'hash',
133 'img_timestamp' => '20150101000000',
137 'text' => 'User reverted File:File.png to an old version',
139 'img_sha1' => 'hash',
140 'img_timestamp' => '2015-01-01T00:00:00Z',
145 // Old format without params
149 'action' => 'revert',
150 'comment' => 'upload comment',
151 'namespace' => NS_FILE
,
152 'title' => 'File.png',
156 'text' => 'User reverted File:File.png to an old version',
164 * @dataProvider provideRevertLogDatabaseRows
166 public function testRevertLogDatabaseRows( $row, $extra ) {
167 $this->doTestLogFormatter( $row, $extra );