BUGFIX: BasicAuthTests fail when Member's unique_identifier_field is anything except the default of Email (from r109834)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112831 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-19 01:26:49 +00:00
parent 2c7d88aade
commit 274387f0f4

View File

@ -6,12 +6,23 @@
class BasicAuthTest extends FunctionalTest {
static $original_unique_identifier_field;
static $fixture_file = 'sapphire/tests/security/BasicAuthTest.yml';
function setUp() {
parent::setUp();
// Fixtures assume Email is the field used to identify the log in identity
self::$original_unique_identifier_field = Member::get_unique_identifier_field();
Member::set_unique_identifier_field('Email');
}
function tearDown() {
parent::tearDown();
BasicAuth::protect_entire_site(false);
Member::set_unique_identifier_field(self::$original_unique_identifier_field);
}
function testBasicAuthEnabledWithoutLogin() {