Skip to content

Commit e5ffa96

Browse files
committed
AC-8017 system settings improvement
1 parent eaf9fca commit e5ffa96

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/code/Magento/EncryptionKey/Test/Unit/Model/ResourceModel/Key/ChangeTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ public function testChangeEncryptionKeyAutogenerate()
158158
{
159159
$this->setUpChangeEncryptionKey();
160160
$this->randomMock->expects($this->once())->method('getRandomBytes')->willReturn('abc');
161-
$this->assertEquals(ConfigOptionsListConstants::STORE_KEY_ENCODED_RANDOM_STRING_PREFIX . 'abc', $this->model->changeEncryptionKey());
161+
$this->assertEquals(
162+
ConfigOptionsListConstants::STORE_KEY_ENCODED_RANDOM_STRING_PREFIX . 'abc',
163+
$this->model->changeEncryptionKey()
164+
);
162165
}
163166

164167
public function testChangeEncryptionKeyThrowsException()

setup/src/Magento/Setup/Test/Unit/Module/ConfigGeneratorTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected function setUp(): void
3939
/** @var Random|MockObject $randomMock */
4040
$randomMock = $this->createMock(Random::class);
4141
$randomMock->expects($this->any())->method('getRandomString')->willReturn('key');
42+
$randomMock->expects($this->any())->method('getRandomBytes')->willReturn('randombytes');
4243

4344
$cryptKeyGenerator = new CryptKeyGenerator($randomMock);
4445

@@ -78,7 +79,11 @@ public function testCreateCryptConfigWithoutInput()
7879
$returnValue = $this->configGeneratorObject->createCryptConfig([]);
7980
$this->assertEquals(ConfigFilePool::APP_ENV, $returnValue->getFileKey());
8081
// phpcs:ignore Magento2.Security.InsecureFunction
81-
$this->assertEquals(['crypt' => ['key' => 'key']], $returnValue->getData());
82+
$this->assertEquals([
83+
'crypt' => [
84+
'key' => ConfigOptionsListConstants::STORE_KEY_ENCODED_RANDOM_STRING_PREFIX . 'randombytes'
85+
]
86+
], $returnValue->getData());
8287
}
8388

8489
public function testCreateSessionConfigWithInput()

0 commit comments

Comments
 (0)