mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '5' into 6
This commit is contained in:
commit
32e6169da1
@ -68,7 +68,7 @@ use SilverStripe\View\ArrayData;
|
||||
* DropdownField::create(
|
||||
* 'Country',
|
||||
* 'Country',
|
||||
* singleton('MyObject')->dbObject('Country')->enumValues()
|
||||
* singleton(MyObject::class)->dbObject('Country')->enumValues()
|
||||
* );
|
||||
* </code>
|
||||
*
|
||||
|
@ -521,13 +521,11 @@ class Member extends DataObject
|
||||
|
||||
// If the algorithm or salt is not available, it means we are operating
|
||||
// on legacy account with unhashed password. Do not hash the string.
|
||||
if (!$this->PasswordEncryption) {
|
||||
if (!$this->PasswordEncryption || !$this->Salt) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
// We assume we have PasswordEncryption and Salt available here.
|
||||
$e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption);
|
||||
|
||||
return $e->encrypt($string, $this->Salt);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ class VersionProviderTest extends SapphireTest
|
||||
public function testGetModuleVersionFromComposer()
|
||||
{
|
||||
Config::modify()->set(VersionProvider::class, 'modules', [
|
||||
'silverstripe/siteconfig' => 'SiteConfig',
|
||||
'silverstripe/config' => 'Config',
|
||||
'silverstripe/framework' => 'Framework',
|
||||
]);
|
||||
|
||||
@ -77,17 +77,20 @@ class VersionProviderTest extends SapphireTest
|
||||
public function testGetVersion()
|
||||
{
|
||||
Config::modify()->set(VersionProvider::class, 'modules', [
|
||||
'silverstripe/siteconfig' => 'SiteConfig',
|
||||
'silverstripe/config' => 'Config',
|
||||
'silverstripe/framework' => 'Framework'
|
||||
]);
|
||||
$result = $this->getProvider()->getVersion();
|
||||
$this->assertStringNotContainsString('SiteConfig: ', $result);
|
||||
$this->assertStringNotContainsString('Config: ', $result);
|
||||
$this->assertStringContainsString('Framework: ', $result);
|
||||
$this->assertStringNotContainsString(', ', $result);
|
||||
}
|
||||
|
||||
public function testGetModuleVersion()
|
||||
{
|
||||
if (!class_exists(VersionParser::class)) {
|
||||
$this->markTestSkipped('This test requires composer/semver to be installed');
|
||||
}
|
||||
$provider = $this->getProvider();
|
||||
Config::modify()->set(VersionProvider::class, 'modules', [
|
||||
'silverstripe/framework' => 'Framework',
|
||||
|
Loading…
Reference in New Issue
Block a user