diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-22 08:22:10 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 13:34:41 +0100 |
commit | 3aa5f105fa2c763a57130c81a2e79a968a098777 (patch) | |
tree | 6eb13127ee3420fb331ea638a78956593cbf31a8 /tests | |
parent | bfaca7fc78680f8efa4405d497a13a32e760b7ba (diff) | |
download | nextcloud-server-3aa5f105fa2c763a57130c81a2e79a968a098777.tar.gz nextcloud-server-3aa5f105fa2c763a57130c81a2e79a968a098777.zip |
Fix more tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Collaboration/Collaborators/UserPluginTest.php | 4 | ||||
-rw-r--r-- | tests/lib/Session/CryptoSessionDataTest.php | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index b9f10a54fa0..57b9cbde856 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -414,8 +414,8 @@ class UserPluginTest extends TestCase { $this->groupManager->expects($this->exactly(2)) ->method('getUserGroupIds') ->withConsecutive( - $this->user, - $singleUser + [$this->user], + [$singleUser] ) ->willReturn($groupResponse); } else { 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); }); |