File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
app/code/Magento/EncryptionKey/Test/Unit/Model/ResourceModel/Key
setup/src/Magento/Setup/Test/Unit/Module Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,10 @@ public function testChangeEncryptionKeyAutogenerate()
158
158
{
159
159
$ this ->setUpChangeEncryptionKey ();
160
160
$ 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
+ );
162
165
}
163
166
164
167
public function testChangeEncryptionKeyThrowsException ()
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ protected function setUp(): void
39
39
/** @var Random|MockObject $randomMock */
40
40
$ randomMock = $ this ->createMock (Random::class);
41
41
$ randomMock ->expects ($ this ->any ())->method ('getRandomString ' )->willReturn ('key ' );
42
+ $ randomMock ->expects ($ this ->any ())->method ('getRandomBytes ' )->willReturn ('randombytes ' );
42
43
43
44
$ cryptKeyGenerator = new CryptKeyGenerator ($ randomMock );
44
45
@@ -78,7 +79,11 @@ public function testCreateCryptConfigWithoutInput()
78
79
$ returnValue = $ this ->configGeneratorObject ->createCryptConfig ([]);
79
80
$ this ->assertEquals (ConfigFilePool::APP_ENV , $ returnValue ->getFileKey ());
80
81
// 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 ());
82
87
}
83
88
84
89
public function testCreateSessionConfigWithInput ()
You can’t perform that action at this time.
0 commit comments