From 21% to 82%. * Added missing @covers, broadened @covers where appropriate. * Added tests for some code that lacked them. * Added a parameter to control the use of hash_pbkdf2() so that the pure PHP fallback could be tested. In the non-fallback test, force the use of the extension, and mark it skipped if it is not installed. Bug: T167003 Change-Id: I987e1a89ec343907f4ead7f6192b2d4deb58ac16
24 lines
642 B
PHP
24 lines
642 B
PHP
<?php
|
|
|
|
/**
|
|
* @covers MWOldPassword
|
|
* @covers ParameterizedPassword
|
|
* @covers Password
|
|
*/
|
|
class MWOldPasswordTest extends PasswordTestCase {
|
|
protected function getTypeConfigs() {
|
|
return [ 'A' => [
|
|
'class' => 'MWOldPassword',
|
|
] ];
|
|
}
|
|
|
|
public static function providePasswordTests() {
|
|
return [
|
|
[ true, ':A:5f4dcc3b5aa765d61d8327deb882cf99', 'password' ],
|
|
// Type-B password with incorrect type name is accepted
|
|
[ true, ':A:salt:9842afc7cb949c440c51347ed809362f', 'password' ],
|
|
[ false, ':A:d529e941509eb9e9b9cfaeae1fe7ca23', 'password' ],
|
|
[ false, ':A:salt:d529e941509eb9e9b9cfaeae1fe7ca23', 'password' ],
|
|
];
|
|
}
|
|
}
|