diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-09-08 21:16:11 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-09-09 12:48:08 +0200 |
commit | e579dd62fd4d4622766ecf60473dba41d3fbed9b (patch) | |
tree | 5bb0fb12a72d0a72638a88e8b4399f36e8e048f6 /tests/lib/session | |
parent | bfa26db4727cf5cf9a26754b82e65a38ffc98bbd (diff) | |
download | nextcloud-server-e579dd62fd4d4622766ecf60473dba41d3fbed9b.tar.gz nextcloud-server-e579dd62fd4d4622766ecf60473dba41d3fbed9b.zip |
Write session data to single key
This prevents decrypting values multiple times.
Diffstat (limited to 'tests/lib/session')
-rw-r--r-- | tests/lib/session/cryptowrappingtest.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/lib/session/cryptowrappingtest.php b/tests/lib/session/cryptowrappingtest.php index 12b3c905b7f..1cbe60066fe 100644 --- a/tests/lib/session/cryptowrappingtest.php +++ b/tests/lib/session/cryptowrappingtest.php @@ -62,8 +62,8 @@ class CryptoWrappingTest extends TestCase { $this->wrappedSession->expects($this->once()) ->method('set') - ->with('key', $this->crypto->encrypt(json_encode($unencryptedValue))); - $this->instance->set('key', $unencryptedValue); + ->with('encrypted_session_data', $this->crypto->encrypt(json_encode(['encrypted_session_data' => $unencryptedValue]))); + $this->instance->set('encrypted_session_data', $unencryptedValue); } public function testUnwrappingGet() { @@ -72,11 +72,11 @@ class CryptoWrappingTest extends TestCase { $this->wrappedSession->expects($this->once()) ->method('get') - ->with('key') + ->with('encrypted_session_data') ->willReturnCallback(function () use ($encryptedValue) { return $encryptedValue; }); - $this->assertSame($unencryptedValue, $this->wrappedSession->get('key')); + $this->assertSame($unencryptedValue, $this->wrappedSession->get('encrypted_session_data')); } } |