mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Update test runner so that password validation config isn't tested by default
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62654 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c20c4ae6b0
commit
ffcac733e9
@ -20,6 +20,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
static $fixture_file = null;
|
||||
|
||||
protected $originalMailer;
|
||||
protected $originalMemberPasswordValidator;
|
||||
|
||||
protected $mailer;
|
||||
|
||||
@ -29,6 +30,10 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
protected $fixture;
|
||||
|
||||
function setUp() {
|
||||
// Remove password validation
|
||||
$this->originalMemberPasswordValidator = Member::password_validator();
|
||||
Member::set_password_validator(null);
|
||||
|
||||
$className = get_class($this);
|
||||
$fixtureFile = eval("return {$className}::\$fixture_file;");
|
||||
|
||||
@ -114,6 +119,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
Email::set_mailer($this->originalMailer);
|
||||
$this->originalMailer = null;
|
||||
$this->mailer = null;
|
||||
|
||||
// Restore password validation
|
||||
Member::set_password_validator($this->originalMemberPasswordValidator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -147,6 +147,13 @@ class Member extends DataObject {
|
||||
static function set_password_validator($pv) {
|
||||
self::$password_validator = $pv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current {@link PasswordValidator}
|
||||
*/
|
||||
static function password_validator() {
|
||||
return self::$password_validator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the number of days that a password should be valid for.
|
||||
|
Loading…
Reference in New Issue
Block a user