Skip to content

Commit ac5444d

Browse files
gr8manmichalsn
andauthored
Update tests/system/Encryption/Handlers/SodiumHandlerTest.php
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
1 parent c29fbc0 commit ac5444d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/system/Encryption/Handlers/SodiumHandlerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,14 @@ public function testInternalKeyNotModifiedByParams(): void
153153
$this->assertSame($message, $encrypter->decrypt($encoded, ['key' => $differentKey]));
154154
}
155155

156-
public function testBug0IssetThrowsTypeError(): void
156+
public function testNullKeyOverrideFallsBackToInstanceKey(): void
157157
{
158-
$this->expectException(EncryptionException::class);
159158
/** @var SodiumHandler $encrypter */
160159
$encrypter = $this->encryption->initialize($this->config);
161160

162-
$encrypter->encrypt('message', ['key' => null]);
161+
$ciphertext = $encrypter->encrypt('message', ['key' => null]);
162+
163+
$this->assertSame('message', $encrypter->decrypt($ciphertext, ['key' => null]));
163164
}
164165

165166
public function testBug1MemzeroZeroesInternalKey(): void

0 commit comments

Comments
 (0)