Merge "HTML escape parameter 'text' of hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / tests / phpunit / includes / user / PasswordResetTest.php
index 4978b72..ca57c10 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 use MediaWiki\Auth\AuthManager;
+use MediaWiki\Block\SystemBlock;
 
 /**
  * @covers PasswordReset
@@ -102,36 +103,42 @@ class PasswordResetTest extends MediaWikiTestCase {
                                'enableEmail' => true,
                                'allowsAuthenticationDataChange' => true,
                                'canEditPrivate' => true,
-                               'block' => new Block( [ 'systemBlock' => 'proxy' ] ),
+                               'block' => new SystemBlock(
+                                       [ 'systemBlock' => 'proxy' ]
+                               ),
                                'globalBlock' => null,
                                'isAllowed' => false,
                        ],
-                       'globally blocked with account creation disabled' => [
+                       'globally blocked with account creation not disabled' => [
                                'passwordResetRoutes' => [ 'username' => true ],
                                'enableEmail' => true,
                                'allowsAuthenticationDataChange' => true,
                                'canEditPrivate' => true,
                                'block' => null,
-                               'globalBlock' => new Block( [ 'systemBlock' => 'global-block', 'createAccount' => true ] ),
-                               'isAllowed' => false,
+                               'globalBlock' => new SystemBlock(
+                                       [ 'systemBlock' => 'global-block' ]
+                               ),
+                               'isAllowed' => true,
                        ],
-                       'globally blocked with account creation not disabled' => [
+                       'blocked via wgSoftBlockRanges' => [
                                'passwordResetRoutes' => [ 'username' => true ],
                                'enableEmail' => true,
                                'allowsAuthenticationDataChange' => true,
                                'canEditPrivate' => true,
-                               'block' => null,
-                               'globalBlock' => new Block( [ 'systemBlock' => 'global-block', 'createAccount' => false ] ),
+                               'block' => new SystemBlock(
+                                       [ 'systemBlock' => 'wgSoftBlockRanges', 'anonOnly' => true ]
+                               ),
+                               'globalBlock' => null,
                                'isAllowed' => true,
                        ],
-                       'blocked via wgSoftBlockRanges' => [
+                       'blocked with an unknown system block type' => [
                                'passwordResetRoutes' => [ 'username' => true ],
                                'enableEmail' => true,
                                'allowsAuthenticationDataChange' => true,
                                'canEditPrivate' => true,
-                               'block' => new Block( [ 'systemBlock' => 'wgSoftBlockRanges', 'anonOnly' => true ] ),
+                               'block' => new SystemBlock( [ 'systemBlock' => 'unknown' ] ),
                                'globalBlock' => null,
-                               'isAllowed' => true,
+                               'isAllowed' => false,
                        ],
                        'all OK' => [
                                'passwordResetRoutes' => [ 'username' => true ],