Merge pull request #8604 from creative-commoners/pulls/4.3/password-validator-test-fixes

FIX Ensure that tests setting passwords have stubbed configuration
This commit is contained in:
Andre Kiste 2018-11-15 15:34:21 +13:00 committed by GitHub
commit 34103f5e8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -9,9 +9,18 @@ use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\RequiredFields;
use SilverStripe\Security\Member;
use SilverStripe\Security\PasswordValidator;
class ConfirmedPasswordFieldTest extends SapphireTest
{
protected $usesDatabase = true;
protected function setUp()
{
parent::setUp();
PasswordValidator::singleton()->setMinLength(0);
}
public function testSetValue()
{

View File

@ -22,6 +22,7 @@ use SilverStripe\Security\MemberAuthenticator\MemberAuthenticator;
use SilverStripe\Security\MemberAuthenticator\SessionAuthenticationHandler;
use SilverStripe\Security\MemberPassword;
use SilverStripe\Security\PasswordEncryptor_Blowfish;
use SilverStripe\Security\PasswordValidator;
use SilverStripe\Security\Permission;
use SilverStripe\Security\RememberLoginHash;
use SilverStripe\Security\Security;
@ -55,7 +56,8 @@ class MemberTest extends FunctionalTest
parent::setUp();
Member::config()->set('unique_identifier_field', 'Email');
Member::set_password_validator(null);
PasswordValidator::singleton()->setMinLength(0);
i18n::set_locale('en_US');
}