Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / BlockLogFormatterTest.php
index 0041b9c..b6f8f9c 100644 (file)
@@ -34,6 +34,30 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                                'duration' => 'infinite',
                                                'flags' => [ 'anononly' ],
                                        ],
+                                       'preload' => [ new TitleValue( NS_USER_TALK, 'Logtestuser' ) ],
+                               ],
+                       ],
+
+                       // With blank page title (T224811)
+                       [
+                               [
+                                       'type' => 'block',
+                                       'action' => 'block',
+                                       'comment' => 'Block comment',
+                                       'user' => 0,
+                                       'user_text' => 'Sysop',
+                                       'namespace' => NS_USER,
+                                       'title' => '',
+                                       'params' => [],
+                               ],
+                               [
+                                       'text' => 'Sysop blocked (no username available) '
+                                               . 'with an expiration time of indefinite',
+                                       'api' => [
+                                               'duration' => 'infinite',
+                                               'flags' => [],
+                                       ],
+                                       'preload' => [],
                                ],
                        ],
 
@@ -401,7 +425,8 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        'api' => [
                                                'duration' => 'infinite',
                                                'flags' => [ 'anononly' ],
-                                               'restrictions' => [ 'pages' => [
+                                               'restrictions' => [
+                                                       'pages' => [
                                                                [
                                                                        'page_ns' => 2,
                                                                        'page_title' => 'User:Test1',
@@ -415,6 +440,76 @@ class BlockLogFormatterTest extends LogFormatterTestCase {
                                        ],
                                ],
                        ],
+                       [
+                               [
+                                       'type' => 'block',
+                                       'action' => 'block',
+                                       'comment' => 'Block comment',
+                                       'user' => 0,
+                                       'user_text' => 'Sysop',
+                                       'namespace' => NS_USER,
+                                       'title' => 'Logtestuser',
+                                       'params' => [
+                                               '5::duration' => 'infinite',
+                                               '6::flags' => 'anononly',
+                                               '7::restrictions' => [
+                                                       'namespaces' => [ NS_USER ],
+                                               ],
+                                               'sitewide' => false,
+                                       ],
+                               ],
+                               [
+                                       'text' => 'Sysop blocked Logtestuser from editing the namespace User'
+                                               . ' with an expiration time of indefinite (anonymous users only)',
+                                       'api' => [
+                                               'duration' => 'infinite',
+                                               'flags' => [ 'anononly' ],
+                                               'restrictions' => [
+                                                       'namespaces' => [ NS_USER ],
+                                               ],
+                                               'sitewide' => false,
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'type' => 'block',
+                                       'action' => 'block',
+                                       'comment' => 'Block comment',
+                                       'user' => 0,
+                                       'user_text' => 'Sysop',
+                                       'namespace' => NS_USER,
+                                       'title' => 'Logtestuser',
+                                       'params' => [
+                                               '5::duration' => 'infinite',
+                                               '6::flags' => 'anononly',
+                                               '7::restrictions' => [
+                                                       'pages' => [ 'Main Page' ],
+                                                       'namespaces' => [ NS_USER, NS_MAIN ],
+                                               ],
+                                               'sitewide' => false,
+                                       ],
+                               ],
+                               [
+                                       'text' => 'Sysop blocked Logtestuser from editing the page Main Page and the'
+                                               . ' namespaces User and (Main) with an expiration time of indefinite'
+                                               . ' (anonymous users only)',
+                                       'api' => [
+                                               'duration' => 'infinite',
+                                               'flags' => [ 'anononly' ],
+                                               'restrictions' => [
+                                                       'pages' => [
+                                                               [
+                                                                       'page_ns' => 0,
+                                                                       'page_title' => 'Main Page',
+                                                               ],
+                                                       ],
+                                                       'namespaces' => [ NS_USER, NS_MAIN ],
+                                               ],
+                                               'sitewide' => false,
+                                       ],
+                               ],
+                       ],
                        [
                                [
                                        'type' => 'block',