Merge branch '5' into 6

This commit is contained in:
github-actions 2024-03-09 14:25:07 +00:00
commit 32e6169da1
3 changed files with 8 additions and 7 deletions

View File

@ -68,7 +68,7 @@ use SilverStripe\View\ArrayData;
* DropdownField::create(
* 'Country',
* 'Country',
* singleton('MyObject')->dbObject('Country')->enumValues()
* singleton(MyObject::class)->dbObject('Country')->enumValues()
* );
* </code>
*

View File

@ -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);
}

View File

@ -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',