aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Session/CryptoSessionDataTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Session/CryptoSessionDataTest.php')
-rw-r--r--tests/lib/Session/CryptoSessionDataTest.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/lib/Session/CryptoSessionDataTest.php b/tests/lib/Session/CryptoSessionDataTest.php
index 472856b90d9..6de44032530 100644
--- a/tests/lib/Session/CryptoSessionDataTest.php
+++ b/tests/lib/Session/CryptoSessionDataTest.php
@@ -22,6 +22,7 @@
namespace Test\Session;
use OC\Session\CryptoSessionData;
+use OCP\Security\ICrypto;
class CryptoSessionDataTest extends Session {
/** @var \PHPUnit_Framework_MockObject_MockObject|\OCP\Security\ICrypto */
@@ -34,9 +35,7 @@ class CryptoSessionDataTest extends Session {
parent::setUp();
$this->wrappedSession = new \OC\Session\Memory($this->getUniqueID());
- $this->crypto = $this->getMockBuilder('OCP\Security\ICrypto')
- ->disableOriginalConstructor()
- ->getMock();
+ $this->crypto = $this->createMock(ICrypto::class);
$this->crypto->expects($this->any())
->method('encrypt')
->willReturnCallback(function ($input) {
@@ -45,6 +44,9 @@ class CryptoSessionDataTest extends Session {
$this->crypto->expects($this->any())
->method('decrypt')
->willReturnCallback(function ($input) {
+ if ($input === '') {
+ return '';
+ }
return substr($input, 1, -1);
});