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:
Sam Minnee 2008-09-18 03:59:00 +00:00
parent c20c4ae6b0
commit ffcac733e9
2 changed files with 15 additions and 0 deletions

View File

@ -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);
}
/**

View File

@ -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.