Convert all array() syntax to []
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / BlockLogFormatterTest.php
index c7dc641..8102437 100644 (file)
@@ -8,10 +8,10 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
         * Do not change the existing data, just add a new database row
         */
        public static function provideBlockLogDatabaseRows() {
-               return array(
+               return [
                        // Current log format
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'block',
                                        'comment' => 'Block comment',
@@ -19,23 +19,23 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                '5::duration' => 'infinite',
                                                '6::flags' => 'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'text' => 'Sysop blocked Logtestuser with an expiry time of indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
 
                        // Old legacy log
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'block',
                                        'comment' => 'Block comment',
@@ -43,24 +43,24 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                'infinite',
                                                'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'legacy' => true,
                                        'text' => 'Sysop blocked Logtestuser with an expiry time of indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
 
                        // Old legacy log without flag
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'block',
                                        'comment' => 'Block comment',
@@ -68,23 +68,23 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                'infinite',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'legacy' => true,
                                        'text' => 'Sysop blocked Logtestuser with an expiry time of indefinite',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array(),
-                                       ),
-                               ),
-                       ),
+                                               'flags' => [],
+                                       ],
+                               ],
+                       ],
 
                        // Very old legacy log without duration
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'block',
                                        'comment' => 'Block comment',
@@ -92,18 +92,18 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(),
-                               ),
-                               array(
+                                       'params' => [],
+                               ],
+                               [
                                        'legacy' => true,
                                        'text' => 'Sysop blocked Logtestuser with an expiry time of indefinite',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array(),
-                                       ),
-                               ),
-                       ),
-               );
+                                               'flags' => [],
+                                       ],
+                               ],
+                       ],
+               ];
        }
 
        /**
@@ -119,10 +119,10 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
         * Do not change the existing data, just add a new database row
         */
        public static function provideReblockLogDatabaseRows() {
-               return array(
+               return [
                        // Current log format
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'reblock',
                                        'comment' => 'Block comment',
@@ -130,24 +130,24 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                '5::duration' => 'infinite',
                                                '6::flags' => 'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'text' => 'Sysop changed block settings for Logtestuser with an expiry time of'
                                                . ' indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
 
                        // Old log
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'reblock',
                                        'comment' => 'Block comment',
@@ -155,25 +155,25 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                'infinite',
                                                'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'legacy' => true,
                                        'text' => 'Sysop changed block settings for Logtestuser with an expiry time of'
                                                . ' indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
 
                        // Older log without flag
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'reblock',
                                        'comment' => 'Block comment',
@@ -181,20 +181,20 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                'infinite',
-                                       )
-                               ),
-                               array(
+                                       ]
+                               ],
+                               [
                                        'legacy' => true,
                                        'text' => 'Sysop changed block settings for Logtestuser with an expiry time of indefinite',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array(),
-                                       ),
-                               ),
-                       ),
-               );
+                                               'flags' => [],
+                                       ],
+                               ],
+                       ],
+               ];
        }
 
        /**
@@ -210,10 +210,10 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
         * Do not change the existing data, just add a new database row
         */
        public static function provideUnblockLogDatabaseRows() {
-               return array(
+               return [
                        // Current log format
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'block',
                                        'action' => 'unblock',
                                        'comment' => 'Block comment',
@@ -221,14 +221,14 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(),
-                               ),
-                               array(
+                                       'params' => [],
+                               ],
+                               [
                                        'text' => 'Sysop unblocked Logtestuser',
-                                       'api' => array(),
-                               ),
-                       ),
-               );
+                                       'api' => [],
+                               ],
+                       ],
+               ];
        }
 
        /**
@@ -244,10 +244,10 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
         * Do not change the existing data, just add a new database row
         */
        public static function provideSuppressBlockLogDatabaseRows() {
-               return array(
+               return [
                        // Current log format
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'suppress',
                                        'action' => 'block',
                                        'comment' => 'Block comment',
@@ -255,23 +255,23 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                '5::duration' => 'infinite',
                                                '6::flags' => 'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'text' => 'Sysop blocked Logtestuser with an expiry time of indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
 
                        // legacy log
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'suppress',
                                        'action' => 'block',
                                        'comment' => 'Block comment',
@@ -279,21 +279,21 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                'infinite',
                                                'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'legacy' => true,
                                        'text' => 'Sysop blocked Logtestuser with an expiry time of indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
-               );
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
+               ];
        }
 
        /**
@@ -309,10 +309,10 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
         * Do not change the existing data, just add a new database row
         */
        public static function provideSuppressReblockLogDatabaseRows() {
-               return array(
+               return [
                        // Current log format
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'suppress',
                                        'action' => 'reblock',
                                        'comment' => 'Block comment',
@@ -320,24 +320,24 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                '5::duration' => 'infinite',
                                                '6::flags' => 'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'text' => 'Sysop changed block settings for Logtestuser with an expiry time of'
                                                . ' indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
 
                        // Legacy format
-                       array(
-                               array(
+                       [
+                               [
                                        'type' => 'suppress',
                                        'action' => 'reblock',
                                        'comment' => 'Block comment',
@@ -345,22 +345,22 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'user_text' => 'Sysop',
                                        'namespace' => NS_USER,
                                        'title' => 'Logtestuser',
-                                       'params' => array(
+                                       'params' => [
                                                'infinite',
                                                'anononly',
-                                       ),
-                               ),
-                               array(
+                                       ],
+                               ],
+                               [
                                        'legacy' => true,
                                        'text' => 'Sysop changed block settings for Logtestuser with an expiry time of'
                                                . ' indefinite (anonymous users only)',
-                                       'api' => array(
+                                       'api' => [
                                                'duration' => 'infinite',
-                                               'flags' => array( 'anononly' ),
-                                       ),
-                               ),
-                       ),
-               );
+                                               'flags' => [ 'anononly' ],
+                                       ],
+                               ],
+                       ],
+               ];
        }
 
        /**