3 class UploadLogFormatterTest
extends LogFormatterTestCase
{
6 * Provide different rows from the logging table to test
7 * for backward compatibility.
8 * Do not change the existing data, just add a new database row
10 public static function provideUploadLogDatabaseRows() {
17 'comment' => 'upload comment',
18 'namespace' => NS_FILE
,
19 'title' => 'File.png',
22 'img_timestamp' => '20150101000000',
26 'text' => 'User uploaded File:File.png',
29 'img_timestamp' => '2015-01-01T00:00:00Z',
34 // Old format without params
39 'comment' => 'upload comment',
40 'namespace' => NS_FILE
,
41 'title' => 'File.png',
45 'text' => 'User uploaded File:File.png',
53 * @dataProvider provideUploadLogDatabaseRows
55 public function testUploadLogDatabaseRows( $row, $extra ) {
56 $this->doTestLogFormatter( $row, $extra );
60 * Provide different rows from the logging table to test
61 * for backward compatibility.
62 * Do not change the existing data, just add a new database row
64 public static function provideOverwriteLogDatabaseRows() {
70 'action' => 'overwrite',
71 'comment' => 'upload comment',
72 'namespace' => NS_FILE
,
73 'title' => 'File.png',
76 'img_timestamp' => '20150101000000',
80 'text' => 'User uploaded a new version of File:File.png',
83 'img_timestamp' => '2015-01-01T00:00:00Z',
88 // Old format without params
92 'action' => 'overwrite',
93 'comment' => 'upload comment',
94 'namespace' => NS_FILE
,
95 'title' => 'File.png',
99 'text' => 'User uploaded a new version of File:File.png',
107 * @dataProvider provideOverwriteLogDatabaseRows
109 public function testOverwriteLogDatabaseRows( $row, $extra ) {
110 $this->doTestLogFormatter( $row, $extra );
114 * Provide different rows from the logging table to test
115 * for backward compatibility.
116 * Do not change the existing data, just add a new database row
118 public static function provideRevertLogDatabaseRows() {
124 'action' => 'revert',
125 'comment' => 'upload comment',
126 'namespace' => NS_FILE
,
127 'title' => 'File.png',
129 'img_sha1' => 'hash',
130 'img_timestamp' => '20150101000000',
134 'text' => 'User uploaded File:File.png',
136 'img_sha1' => 'hash',
137 'img_timestamp' => '2015-01-01T00:00:00Z',
142 // Old format without params
146 'action' => 'revert',
147 'comment' => 'upload comment',
148 'namespace' => NS_FILE
,
149 'title' => 'File.png',
153 'text' => 'User uploaded File:File.png',
161 * @dataProvider provideRevertLogDatabaseRows
163 public function testRevertLogDatabaseRows( $row, $extra ) {
164 $this->doTestLogFormatter( $row, $extra );