X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fpassword%2FPasswordPolicyChecksTest.php;h=215201e9df7830afaf7f333dfc3093127b9b1152;hb=519ff1a402992b6254c6788de83066fc067dabf3;hp=2d20f2c0ce8ddd05bbcf08007e4d6b441f5dc0e4;hpb=0a8e16d7cfe6ccc0d366c9b9435cb618209d46b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php index 2d20f2c0ce..215201e9df 100644 --- a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php +++ b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php @@ -157,6 +157,26 @@ 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