mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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;
|
static $fixture_file = null;
|
||||||
|
|
||||||
protected $originalMailer;
|
protected $originalMailer;
|
||||||
|
protected $originalMemberPasswordValidator;
|
||||||
|
|
||||||
protected $mailer;
|
protected $mailer;
|
||||||
|
|
||||||
@ -29,6 +30,10 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
protected $fixture;
|
protected $fixture;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
|
// Remove password validation
|
||||||
|
$this->originalMemberPasswordValidator = Member::password_validator();
|
||||||
|
Member::set_password_validator(null);
|
||||||
|
|
||||||
$className = get_class($this);
|
$className = get_class($this);
|
||||||
$fixtureFile = eval("return {$className}::\$fixture_file;");
|
$fixtureFile = eval("return {$className}::\$fixture_file;");
|
||||||
|
|
||||||
@ -114,6 +119,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
|||||||
Email::set_mailer($this->originalMailer);
|
Email::set_mailer($this->originalMailer);
|
||||||
$this->originalMailer = null;
|
$this->originalMailer = null;
|
||||||
$this->mailer = null;
|
$this->mailer = null;
|
||||||
|
|
||||||
|
// Restore password validation
|
||||||
|
Member::set_password_validator($this->originalMemberPasswordValidator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -148,6 +148,13 @@ class Member extends DataObject {
|
|||||||
self::$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.
|
* Set the number of days that a password should be valid for.
|
||||||
* Set to null (the default) to have passwords never expire.
|
* Set to null (the default) to have passwords never expire.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user