mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: SecurityTest tests would fail on sites which had set a non-default unique identifier field for Members (from r104016)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112329 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c969e04731
commit
caa2a292bb
@ -14,6 +14,8 @@ class SecurityTest extends FunctionalTest {
|
|||||||
|
|
||||||
protected $priorDefaultAuthenticator = null;
|
protected $priorDefaultAuthenticator = null;
|
||||||
|
|
||||||
|
protected $priorUniqueIdentifierField = null;
|
||||||
|
|
||||||
function setUp() {
|
function setUp() {
|
||||||
// This test assumes that MemberAuthenticator is present and the default
|
// This test assumes that MemberAuthenticator is present and the default
|
||||||
$this->priorAuthenticators = Authenticator::get_authenticators();
|
$this->priorAuthenticators = Authenticator::get_authenticators();
|
||||||
@ -22,6 +24,10 @@ class SecurityTest extends FunctionalTest {
|
|||||||
Authenticator::register('MemberAuthenticator');
|
Authenticator::register('MemberAuthenticator');
|
||||||
Authenticator::set_default_authenticator('MemberAuthenticator');
|
Authenticator::set_default_authenticator('MemberAuthenticator');
|
||||||
|
|
||||||
|
// And that the unique identified field is 'Email'
|
||||||
|
$this->priorUniqueIdentifierField = Member::get_unique_identifier_field();
|
||||||
|
Member::set_unique_identifier_field('Email');
|
||||||
|
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,6 +40,9 @@ class SecurityTest extends FunctionalTest {
|
|||||||
}
|
}
|
||||||
Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
|
Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
|
||||||
|
|
||||||
|
// Restore unique identifier field
|
||||||
|
Member::set_unique_identifier_field($this->priorUniqueIdentifierField);
|
||||||
|
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user