From efd1cf63e22ab48a82f8616652f3c2f02b4dfc68 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Sat, 26 Apr 2008 06:32:42 +0000 Subject: [PATCH] Merged revisions 52617 via svnmerge from http://svn.silverstripe.com/open/modules/sapphire/branches/govtsecurity ........ r52617 | sminnee | 2008-04-13 16:57:53 +1200 (Sun, 13 Apr 2008) | 1 line Updated changed password test to check for a sent email ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53469 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/security/MemberTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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