X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flogging%2FUploadLogFormatterTest.php;h=2b4067f17d7281247feee1614b23ff279d88b21a;hp=12f516138a6a8a3832172802bfbd063b0afebce3;hb=c368a4313b4183af56b0d566e1f7529ba997a110;hpb=d97041a4caa92d46b8f8c231fd3cb4ed2b3da3de diff --git a/tests/phpunit/includes/logging/UploadLogFormatterTest.php b/tests/phpunit/includes/logging/UploadLogFormatterTest.php index 12f516138a..2b4067f17d 100644 --- a/tests/phpunit/includes/logging/UploadLogFormatterTest.php +++ b/tests/phpunit/includes/logging/UploadLogFormatterTest.php @@ -1,5 +1,8 @@ 'upload', 'action' => 'upload', 'comment' => 'upload comment', 'namespace' => NS_FILE, 'title' => 'File.png', - 'params' => array( + 'params' => [ 'img_sha1' => 'hash', 'img_timestamp' => '20150101000000', - ), - ), - array( + ], + ], + [ 'text' => 'User uploaded File:File.png', - 'api' => array( + 'api' => [ 'img_sha1' => 'hash', 'img_timestamp' => '2015-01-01T00:00:00Z', - ), - ), - ), + ], + ], + ], // Old format without params - array( - array( + [ + [ 'type' => 'upload', 'action' => 'upload', 'comment' => 'upload comment', 'namespace' => NS_FILE, 'title' => 'File.png', - 'params' => array(), - ), - array( + 'params' => [], + ], + [ 'text' => 'User uploaded File:File.png', - 'api' => array(), - ), - ), - ); + 'api' => [], + ], + ], + ]; } /** @@ -62,45 +65,45 @@ class UploadLogFormatterTest extends LogFormatterTestCase { * Do not change the existing data, just add a new database row */ public static function provideOverwriteLogDatabaseRows() { - return array( + return [ // Current format - array( - array( + [ + [ 'type' => 'upload', 'action' => 'overwrite', 'comment' => 'upload comment', 'namespace' => NS_FILE, 'title' => 'File.png', - 'params' => array( + 'params' => [ 'img_sha1' => 'hash', 'img_timestamp' => '20150101000000', - ), - ), - array( + ], + ], + [ 'text' => 'User uploaded a new version of File:File.png', - 'api' => array( + 'api' => [ 'img_sha1' => 'hash', 'img_timestamp' => '2015-01-01T00:00:00Z', - ), - ), - ), + ], + ], + ], // Old format without params - array( - array( + [ + [ 'type' => 'upload', 'action' => 'overwrite', 'comment' => 'upload comment', 'namespace' => NS_FILE, 'title' => 'File.png', - 'params' => array(), - ), - array( + 'params' => [], + ], + [ 'text' => 'User uploaded a new version of File:File.png', - 'api' => array(), - ), - ), - ); + 'api' => [], + ], + ], + ]; } /** @@ -116,45 +119,45 @@ class UploadLogFormatterTest extends LogFormatterTestCase { * Do not change the existing data, just add a new database row */ public static function provideRevertLogDatabaseRows() { - return array( + return [ // Current format - array( - array( + [ + [ 'type' => 'upload', 'action' => 'revert', 'comment' => 'upload comment', 'namespace' => NS_FILE, 'title' => 'File.png', - 'params' => array( + 'params' => [ 'img_sha1' => 'hash', 'img_timestamp' => '20150101000000', - ), - ), - array( + ], + ], + [ 'text' => 'User uploaded File:File.png', - 'api' => array( + 'api' => [ 'img_sha1' => 'hash', 'img_timestamp' => '2015-01-01T00:00:00Z', - ), - ), - ), + ], + ], + ], // Old format without params - array( - array( + [ + [ 'type' => 'upload', 'action' => 'revert', 'comment' => 'upload comment', 'namespace' => NS_FILE, 'title' => 'File.png', - 'params' => array(), - ), - array( + 'params' => [], + ], + [ 'text' => 'User uploaded File:File.png', - 'api' => array(), - ), - ), - ); + 'api' => [], + ], + ], + ]; } /**