BUGFIX Fixed SapphireTest->loginWithPermission() and MemberAuthenticatorTest to use existing Members based on their unique_identifier_field (if existing) to accommodate recent Member->onBeforeWrite() changes (see r100705)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100723 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-03-09 20:37:43 +00:00 committed by Sam Minnee
parent 90e8171536
commit 83675fc248
2 changed files with 5 additions and 3 deletions

View File

@ -686,7 +686,9 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
$permission->write();
$group->Permissions()->add($permission);
$member = new Member();
$member = DataObject::get_one('Member', sprintf('"Email" = \'%s\'', "$permCode@example.org"));
if(!$member) $member = new Member();
$member->FirstName = $permCode;
$member->Surname = "User";
$member->Email = "$permCode@example.org";

View File

@ -9,7 +9,7 @@ class MemberAuthenticatorTest extends SapphireTest {
$field=Member::get_unique_identifier_field();
$member->$field = 'test@test.com';
$member->$field = 'test1@test.com';
$member->PasswordEncryption = "sha1";
$member->Password = "mypassword";
$member->write();
@ -32,7 +32,7 @@ class MemberAuthenticatorTest extends SapphireTest {
$field=Member::get_unique_identifier_field();
$member = new Member();
$member->$field = 'test@test.com';
$member->$field = 'test2@test.com';
$member->PasswordEncryption = "crc32";
$member->Password = "mypassword";
$member->write();