Remove hard deprecation of PasswordPolicyChecks::checkPopularPasswordBlacklist
[lhc/web/wiklou.git] / tests / phpunit / includes / password / PasswordPolicyChecksTest.php
index 2d20f2c..7ee1ec9 100644 (file)
@@ -157,9 +157,30 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase {
                $this->assertSame( $expected, $status->isGood() );
        }
 
+       public static function provideLargeBlacklist() {
+               return [
+                       [ false, 'testpass' ],
+                       [ false, 'password' ],
+                       [ false, '12345' ],
+                       [ true, 'DKn17egcA4' ],
+                       [ true, 'testwikijenkinspass' ],
+               ];
+       }
+
+       /**
+        * @covers PasswordPolicyChecks::checkPasswordNotInLargeBlacklist
+        * @dataProvider provideLargeBlacklist
+        */
+       public function testCheckNotInLargeBlacklist( $expected, $password ) {
+               $user = User::newFromName( 'username' );
+               $status = PasswordPolicyChecks::checkPasswordNotInLargeBlacklist( true, $user, $password );
+               $this->assertSame( $expected, $status->isGood() );
+       }
+
        /**
         * Verify that all password policy description messages actually exist.
         * Messages used on Special:PasswordPolicies
+        * @coversNothing
         */
        public function testPasswordPolicyDescriptionsExist() {
                global $wgPasswordPolicy;