summaryrefslogtreecommitdiffstats
path: root/tests/lib/session
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-08-21 18:27:52 +0200
committerLukas Reschke <lukas@owncloud.com>2015-08-21 19:16:28 +0200
commit6a3fb0d3b36dce7a6583d58ded1b133f086e2a95 (patch)
treef71899e7cc21d88b9224f4b7111dc40d54e34a84 /tests/lib/session
parent36eef2ddabd77ff6279f3bd6896ced4959f1c370 (diff)
downloadnextcloud-server-6a3fb0d3b36dce7a6583d58ded1b133f086e2a95.tar.gz
nextcloud-server-6a3fb0d3b36dce7a6583d58ded1b133f086e2a95.zip
Handle failures gracefully, remove switch
Diffstat (limited to 'tests/lib/session')
-rw-r--r--tests/lib/session/cryptowrappingtest.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/lib/session/cryptowrappingtest.php b/tests/lib/session/cryptowrappingtest.php
index 6a3f6959962..12b3c905b7f 100644
--- a/tests/lib/session/cryptowrappingtest.php
+++ b/tests/lib/session/cryptowrappingtest.php
@@ -46,7 +46,7 @@ class CryptoWrappingTest extends TestCase {
$this->crypto->expects($this->any())
->method('encrypt')
->willReturnCallback(function ($input) {
- return '#' . $input . '#';
+ return $input;
});
$this->crypto->expects($this->any())
->method('decrypt')
@@ -62,7 +62,7 @@ class CryptoWrappingTest extends TestCase {
$this->wrappedSession->expects($this->once())
->method('set')
- ->with('key', $this->crypto->encrypt($unencryptedValue));
+ ->with('key', $this->crypto->encrypt(json_encode($unencryptedValue)));
$this->instance->set('key', $unencryptedValue);
}
@@ -76,6 +76,7 @@ class CryptoWrappingTest extends TestCase {
->willReturnCallback(function () use ($encryptedValue) {
return $encryptedValue;
});
- $this->assertSame($unencryptedValue, $this->instance->get('key'));
+
+ $this->assertSame($unencryptedValue, $this->wrappedSession->get('key'));
}
}