X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fpassword%2FPasswordPolicyChecksTest.php;h=5ddbe271ebb1c13af2c077ed979e16632cbecce4;hb=7793c8acc6d21c451cd5737fd6b98b1a7d9a5e00;hp=7dfb3cf5f1b0ccb7b6f653bcef29b444121bb3d2;hpb=137c5993e1412ab5b12dfdd2223b206c06205fd8;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php index 7dfb3cf5f1..5ddbe271eb 100644 --- a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php +++ b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php @@ -156,4 +156,21 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase { $status = PasswordPolicyChecks::checkPopularPasswordBlacklist( PHP_INT_MAX, $user, $password ); $this->assertSame( $expected, $status->isGood() ); } + + /** + * Verify that all password policy description messages actually exist. + * Messages used on Special:PasswordPolicies + */ + public function testPasswordPolicyDescriptionsExist() { + global $wgPasswordPolicy; + $lang = Language::factory( 'en' ); + + foreach ( array_keys( $wgPasswordPolicy['checks'] ) as $check ) { + $msgKey = 'passwordpolicies-policy-' . strtolower( $check ); + $this->assertTrue( + wfMessage( $msgKey )->useDatabase( false )->inLanguage( $lang )->exists(), + "Message '$msgKey' required by '$check' must exist" + ); + } + } }