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
@ -13,15 +13,21 @@ class SecurityTest extends FunctionalTest {
|
||||
protected $priorAuthenticators = array();
|
||||
|
||||
protected $priorDefaultAuthenticator = null;
|
||||
|
||||
|
||||
protected $priorUniqueIdentifierField = null;
|
||||
|
||||
function setUp() {
|
||||
// This test assumes that MemberAuthenticator is present and the default
|
||||
$this->priorAuthenticators = Authenticator::get_authenticators();
|
||||
$this->priorDefaultAuthenticator = Authenticator::get_default_authenticator();
|
||||
|
||||
|
||||
Authenticator::register('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();
|
||||
}
|
||||
|
||||
@ -33,6 +39,9 @@ class SecurityTest extends FunctionalTest {
|
||||
Authenticator::unregister('MemberAuthenticator');
|
||||
}
|
||||
Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
|
||||
|
||||
// Restore unique identifier field
|
||||
Member::set_unique_identifier_field($this->priorUniqueIdentifierField);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user