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()
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 ()
Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments