mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Improved robustness of MemberTest
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60391 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
028cb281ce
commit
c812ca5f91
@ -13,6 +13,7 @@ class MemberTest extends SapphireTest {
|
||||
Member::set_password_validator(null);
|
||||
|
||||
$member = $this->objFromFixture('Member', 'test');
|
||||
$this->assertNotNull($member);
|
||||
$member->Password = "test1";
|
||||
$member->write();
|
||||
|
||||
@ -45,6 +46,7 @@ class MemberTest extends SapphireTest {
|
||||
$this->clearEmails();
|
||||
|
||||
$member = $this->objFromFixture('Member', 'test');
|
||||
$this->assertNotNull($member);
|
||||
$valid = $member->changePassword('32asDF##$$%%');
|
||||
$this->assertTrue($valid->valid());
|
||||
/*
|
||||
@ -60,6 +62,7 @@ class MemberTest extends SapphireTest {
|
||||
*/
|
||||
function testValidatePassword() {
|
||||
$member = $this->objFromFixture('Member', 'test');
|
||||
$this->assertNotNull($member);
|
||||
|
||||
Member::set_password_validator(new NZGovtPasswordValidator());
|
||||
|
||||
@ -143,6 +146,7 @@ class MemberTest extends SapphireTest {
|
||||
Member::set_password_expiry(90);
|
||||
|
||||
$member = $this->objFromFixture('Member', 'test');
|
||||
$this->assertNotNull($member);
|
||||
$valid = $member->changePassword("Xx?1234234");
|
||||
$this->assertTrue($valid->valid());
|
||||
|
||||
@ -158,6 +162,7 @@ class MemberTest extends SapphireTest {
|
||||
|
||||
function testIsPasswordExpired() {
|
||||
$member = $this->objFromFixture('Member', 'test');
|
||||
$this->assertNotNull($member);
|
||||
$this->assertFalse($member->isPasswordExpired());
|
||||
|
||||
$member = $this->objFromFixture('Member', 'noexpiry');
|
||||
|
@ -1,18 +1,18 @@
|
||||
Member:
|
||||
test:
|
||||
FirstName: Test
|
||||
Surname: User
|
||||
Email: sam@silverstripe.com
|
||||
Password: 1nitialPassword
|
||||
PasswordExpiry: 2030-01-01
|
||||
expiredpassword:
|
||||
FirstName: Test
|
||||
Surname: User
|
||||
Email: expired@silverstripe.com
|
||||
Password: 1nitialPassword
|
||||
PasswordExpiry: 2006-01-01
|
||||
noexpiry:
|
||||
FirstName: Test
|
||||
Surname: User
|
||||
Email: noexpiry@silverstripe.com
|
||||
Password: 1nitialPassword
|
||||
test:
|
||||
FirstName: Test
|
||||
Surname: User
|
||||
Email: sam@silverstripe.com
|
||||
Password: 1nitialPassword
|
||||
PasswordExpiry: 2030-01-01
|
||||
expiredpassword:
|
||||
FirstName: Test
|
||||
Surname: User
|
||||
Email: expired@silverstripe.com
|
||||
Password: 1nitialPassword
|
||||
PasswordExpiry: 2006-01-01
|
||||
noexpiry:
|
||||
FirstName: Test
|
||||
Surname: User
|
||||
Email: noexpiry@silverstripe.com
|
||||
Password: 1nitialPassword
|
||||
|
Loading…
Reference in New Issue
Block a user