From f8756b1ef4d471d33aaeb63b76e6eb2d6e23bf93 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 28 Jan 2026 10:35:31 -0500 Subject: [PATCH] test(Session): lint/rector cleanup of CryptoWrappingTest Signed-off-by: Josh --- tests/lib/Session/CryptoWrappingTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/lib/Session/CryptoWrappingTest.php b/tests/lib/Session/CryptoWrappingTest.php index 20c7d2027c8..06acfad5e47 100644 --- a/tests/lib/Session/CryptoWrappingTest.php +++ b/tests/lib/Session/CryptoWrappingTest.php @@ -8,8 +8,8 @@ namespace Test\Session; -use OC\Session\CryptoWrapper; use OC\Session\CryptoSessionData; +use OC\Session\CryptoWrapper; use OC\Session\Memory; use OCP\IRequest; use OCP\Security\ICrypto; @@ -38,7 +38,7 @@ class CryptoWrappingTest extends TestCase { private const COOKIE_PASSPHRASE = 'cookiePassphrase'; private const GENERATED_PASSPHRASE = 'generatedPassphrase'; private const SERVER_PROTOCOL = 'https'; - + protected ICrypto|MockObject $crypto; protected ISecureRandom|MockObject $random; protected IRequest|MockObject $request; @@ -134,10 +134,10 @@ class CryptoWrappingTest extends TestCase { $expectedPassphrase = str_pad(self::GENERATED_PASSPHRASE, 128, '_' . __FUNCTION__, STR_PAD_RIGHT); $this->crypto->method('encrypt')->willReturnCallback( - fn($input) => '#' . $input . '#' + fn ($input) => '#' . $input . '#' ); $this->crypto->method('decrypt')->willReturnCallback( - fn($input) => ($input === '' || strlen($input) < 2) ? '' : substr($input, 1, -1) + fn ($input) => ($input === '' || strlen($input) < 2) ? '' : substr($input, 1, -1) ); $this->random->method('generate')->with(128)->willReturn($expectedPassphrase); @@ -145,9 +145,9 @@ class CryptoWrappingTest extends TestCase { $this->request->method('getServerProtocol')->willReturn(self::SERVER_PROTOCOL); $session = new Memory(); - $cryptoWrapper = new CryptoWrapper($this->crypto, $this->random, $this->request); + $cryptoWrapper = new CryptoWrapper($this->crypto, $this->random, $this->request); $wrappedSession = $cryptoWrapper->wrapSession($session); - + $wrappedSession->set($keyName, $unencryptedValue); $wrappedSession->close();