X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Flogging%2FUploadLogFormatterTest.php;h=00d93d148bf30d0b26fc1d7bcb9be76fd6bf028c;hb=a4943f548be4cfc8f286f00fc8064ff0e377f2ba;hp=12f516138a6a8a3832172802bfbd063b0afebce3;hpb=3e19b06deec72b3cca5b527e93f7023cfc4c2293;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/logging/UploadLogFormatterTest.php b/tests/phpunit/includes/logging/UploadLogFormatterTest.php index 12f516138a..00d93d148b 100644 --- a/tests/phpunit/includes/logging/UploadLogFormatterTest.php +++ b/tests/phpunit/includes/logging/UploadLogFormatterTest.php @@ -8,45 +8,45 @@ class UploadLogFormatterTest extends LogFormatterTestCase { * Do not change the existing data, just add a new database row */ public static function provideUploadLogDatabaseRows() { - return array( + return [ // Current format - array( - array( + [ + [ 'type' => '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 +62,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 +116,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' => [], + ], + ], + ]; } /**