diff --git a/tests/security/MemberTest.php b/tests/security/MemberTest.php index 4fda8872e..e57835722 100644 --- a/tests/security/MemberTest.php +++ b/tests/security/MemberTest.php @@ -35,6 +35,18 @@ class MemberTest extends SapphireTest { $this->assertTrue($record->checkPassword('1nitialPassword'), "Password 1nitialPassword not found in MemberRecord"); } + /** + * Test that changed passwords will send an email + */ + function testChangedPasswordEmaling() { + $this->clearEmails(); + + $member = $this->objFromFixture('Member', 'test'); + $valid = $member->changePassword('32asDF##$$%%'); + $this->assertTrue($valid->valid()); + $this->assertEmailSent("sam@silverstripe.com", null, "/changed password/", '/sam@silverstripe\.com.*32asDF##\$\$%%/'); + } + /** * Test that passwords validate against NZ e-government guidelines * - don't allow the use of the last 6 passwords