diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-08-21 18:27:52 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-08-21 19:16:28 +0200 |
commit | 6a3fb0d3b36dce7a6583d58ded1b133f086e2a95 (patch) | |
tree | f71899e7cc21d88b9224f4b7111dc40d54e34a84 /tests/lib/session | |
parent | 36eef2ddabd77ff6279f3bd6896ced4959f1c370 (diff) | |
download | nextcloud-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.php | 7 |
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')); } } |