mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MemberTest and SecurityTest now set the default authenticator to use
This commit is contained in:
parent
acf449011b
commit
123d483213
@ -46,6 +46,17 @@ class MemberTest extends FunctionalTest
|
|||||||
//This is because the test relies on the yaml file being interpreted according to a particular date format
|
//This is because the test relies on the yaml file being interpreted according to a particular date format
|
||||||
//and this setup occurs before the setUp method is run
|
//and this setup occurs before the setUp method is run
|
||||||
i18n::config()->set('default_locale', 'en_US');
|
i18n::config()->set('default_locale', 'en_US');
|
||||||
|
|
||||||
|
// Set the default authenticator to use for these tests
|
||||||
|
Injector::inst()->load([
|
||||||
|
Security::class => [
|
||||||
|
'properties' => [
|
||||||
|
'Authenticators' => [
|
||||||
|
'default' => '%$' . MemberAuthenticator::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -393,6 +404,7 @@ class MemberTest extends FunctionalTest
|
|||||||
$member->PasswordExpiry = date('Y-m-d', time() + 86400);
|
$member->PasswordExpiry = date('Y-m-d', time() + 86400);
|
||||||
$this->assertFalse($member->isPasswordExpired());
|
$this->assertFalse($member->isPasswordExpired());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInGroups()
|
public function testInGroups()
|
||||||
{
|
{
|
||||||
/** @var Member $staffmember */
|
/** @var Member $staffmember */
|
||||||
@ -844,8 +856,8 @@ class MemberTest extends FunctionalTest
|
|||||||
$fields = $member->getCMSFields();
|
$fields = $member->getCMSFields();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @skipUpgrade
|
* @skipUpgrade
|
||||||
*/
|
*/
|
||||||
$this->assertNotNull($fields->dataFieldByName('Email'), 'Scaffolded fields are retained');
|
$this->assertNotNull($fields->dataFieldByName('Email'), 'Scaffolded fields are retained');
|
||||||
$this->assertNull($fields->dataFieldByName('Salt'), 'Field modifications run correctly');
|
$this->assertNull($fields->dataFieldByName('Salt'), 'Field modifications run correctly');
|
||||||
$this->assertNotNull($fields->dataFieldByName('TestMemberField'), 'Extension is applied correctly');
|
$this->assertNotNull($fields->dataFieldByName('TestMemberField'), 'Extension is applied correctly');
|
||||||
|
@ -10,6 +10,7 @@ use SilverStripe\Control\HTTPResponse;
|
|||||||
use SilverStripe\Control\Session;
|
use SilverStripe\Control\Session;
|
||||||
use SilverStripe\Core\Config\Config;
|
use SilverStripe\Core\Config\Config;
|
||||||
use SilverStripe\Core\Convert;
|
use SilverStripe\Core\Convert;
|
||||||
|
use SilverStripe\Core\Injector\Injector;
|
||||||
use SilverStripe\Dev\FunctionalTest;
|
use SilverStripe\Dev\FunctionalTest;
|
||||||
use SilverStripe\i18n\i18n;
|
use SilverStripe\i18n\i18n;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
@ -47,6 +48,17 @@ class SecurityTest extends FunctionalTest
|
|||||||
Config::modify()->set(MemberAuthenticator::class, 'authenticators', []);
|
Config::modify()->set(MemberAuthenticator::class, 'authenticators', []);
|
||||||
Config::modify()->set(MemberAuthenticator::class, 'default_authenticator', MemberAuthenticator::class);
|
Config::modify()->set(MemberAuthenticator::class, 'default_authenticator', MemberAuthenticator::class);
|
||||||
|
|
||||||
|
// Set the default authenticator to use for these tests
|
||||||
|
Injector::inst()->load([
|
||||||
|
Security::class => [
|
||||||
|
'properties' => [
|
||||||
|
'Authenticators' => [
|
||||||
|
'default' => '%$' . MemberAuthenticator::class,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @skipUpgrade
|
* @skipUpgrade
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user