Set default for Block::appliesToPasswordReset to true
[lhc/web/wiklou.git] / tests / phpunit / includes / user / PasswordResetTest.php
index 1f578ab..e8334d6 100644 (file)
@@ -133,6 +133,15 @@ class PasswordResetTest extends MediaWikiTestCase {
                                'globalBlock' => null,
                                'isAllowed' => true,
                        ],
+                       'blocked with an unknown system block type' => [
+                               'passwordResetRoutes' => [ 'username' => true ],
+                               'enableEmail' => true,
+                               'allowsAuthenticationDataChange' => true,
+                               'canEditPrivate' => true,
+                               'block' => new Block( [ 'systemBlock' => 'unknown' ] ),
+                               'globalBlock' => null,
+                               'isAllowed' => false,
+                       ],
                        'all OK' => [
                                'passwordResetRoutes' => [ 'username' => true ],
                                'enableEmail' => true,
@@ -168,6 +177,7 @@ class PasswordResetTest extends MediaWikiTestCase {
                $performingUser = $this->getMockBuilder( User::class )->getMock();
                $performingUser->expects( $this->any() )->method( 'getRequest' )->willReturn( $request );
                $performingUser->expects( $this->any() )->method( 'isAllowed' )->willReturn( true );
+               $performingUser->expects( $this->any() )->method( 'getName' )->willReturn( 'Performer' );
 
                $targetUser1 = $this->getMockBuilder( User::class )->getMock();
                $targetUser2 = $this->getMockBuilder( User::class )->getMock();