From 0bb94b018b55e28eef627af4a9854d4f0babac62 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 13 Nov 2018 14:08:28 +0200 Subject: [PATCH] FIX Remove default password validation rules before running unit tests --- tests/php/Security/PasswordValidatorTest.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/php/Security/PasswordValidatorTest.php b/tests/php/Security/PasswordValidatorTest.php index 4fd99ed08..7fa5637ab 100644 --- a/tests/php/Security/PasswordValidatorTest.php +++ b/tests/php/Security/PasswordValidatorTest.php @@ -2,9 +2,9 @@ namespace SilverStripe\Security\Tests; -use SilverStripe\Security\PasswordValidator; -use SilverStripe\Security\Member; use SilverStripe\Dev\SapphireTest; +use SilverStripe\Security\Member; +use SilverStripe\Security\PasswordValidator; class PasswordValidatorTest extends SapphireTest { @@ -14,6 +14,16 @@ class PasswordValidatorTest extends SapphireTest */ protected $usesDatabase = true; + protected function setUp() + { + parent::setUp(); + + // Unset framework default values + PasswordValidator::config() + ->remove('min_length') + ->remove('historic_count'); + } + public function testValidate() { $v = new PasswordValidator();