Add @covers tags to logging tests
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / ImportLogFormatterTest.php
index 5e67c6b..80e4c0b 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+/**
+ * @covers ImportLogFormatter
+ */
 class ImportLogFormatterTest extends LogFormatterTestCase {
 
        /**
@@ -8,43 +11,43 @@ class ImportLogFormatterTest 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' => 'import',
                                        'action' => 'upload',
                                        'comment' => 'upload comment',
                                        'namespace' => NS_MAIN,
                                        'title' => 'ImportPage',
-                                       'params' => array(
+                                       'params' => [
                                                '4:number:count' => '1',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'text' => 'User imported ImportPage by file upload (1 revision)',
-                                       'api' => array(
+                                       'api' => [
                                                'count' => 1,
-                                       ),
-                               ),
-                       ),
+                                       ],
+                               ],
+                       ],
 
                        // old format - without details
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'import',
                                        'action' => 'upload',
                                        'comment' => '1 revision: import comment',
                                        'namespace' => NS_MAIN,
                                        'title' => 'ImportPage',
-                                       'params' => array(),
-                               ),
-                               array(
+                                       'params' => [],
+                               ],
+                               [
                                        'text' => 'User imported ImportPage by file upload',
-                                       'api' => array(),
-                               ),
-                       ),
-               );
+                                       'api' => [],
+                               ],
+                       ],
+               ];
        }
 
        /**
@@ -60,46 +63,46 @@ class ImportLogFormatterTest extends LogFormatterTestCase {
         * Do not change the existing data, just add a new database row
         */
        public static function provideInterwikiLogDatabaseRows() {
-               return array(
+               return [
                        // Current format
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'import',
                                        'action' => 'interwiki',
                                        'comment' => 'interwiki comment',
                                        'namespace' => NS_MAIN,
                                        'title' => 'ImportPage',
-                                       'params' => array(
+                                       'params' => [
                                                '4:number:count' => '1',
                                                '5:title-link:interwiki' => 'importiw:PageImport',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'text' => 'User imported ImportPage from importiw:PageImport (1 revision)',
-                                       'api' => array(
+                                       'api' => [
                                                'count' => 1,
                                                'interwiki_ns' => 0,
                                                'interwiki_title' => 'importiw:PageImport',
-                                       ),
-                               ),
-                       ),
+                                       ],
+                               ],
+                       ],
 
                        // old format - without details
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'import',
                                        'action' => 'interwiki',
                                        'comment' => '1 revision from importiw:PageImport: interwiki comment',
                                        'namespace' => NS_MAIN,
                                        'title' => 'ImportPage',
-                                       'params' => array(),
-                               ),
-                               array(
+                                       'params' => [],
+                               ],
+                               [
                                        'text' => 'User imported ImportPage from another wiki',
-                                       'api' => array(),
-                               ),
-                       ),
-               );
+                                       'api' => [],
+                               ],
+                       ],
+               ];
        }
 
        /**
@@ -107,16 +110,16 @@ class ImportLogFormatterTest extends LogFormatterTestCase {
         */
        public function testInterwikiLogDatabaseRows( $row, $extra ) {
                // Setup importiw: as interwiki prefix
-               $this->setMwGlobals( 'wgHooks', array(
-                       'InterwikiLoadPrefix' => array(
+               $this->setMwGlobals( 'wgHooks', [
+                       'InterwikiLoadPrefix' => [
                                function ( $prefix, &$data ) {
                                        if ( $prefix == 'importiw' ) {
-                                               $data = array( 'iw_url' => 'wikipedia' );
+                                               $data = [ 'iw_url' => 'wikipedia' ];
                                        }
                                        return false;
                                }
-                       )
-               ) );
+                       ]
+               ] );
 
                $this->doTestLogFormatter( $row, $extra );
        }