aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-02-24 08:54:43 +0100
committerJulius Härtl <jus@bitgrid.net>2019-03-01 20:57:01 +0100
commit6ee7286b419f77ae127257bbbf6a57415678076c (patch)
treeff3da316e3dbfcf8cf8ceb633a38119e51c7314d
parentba2b5427753c827ad34388ac26ed67f3b72812c2 (diff)
downloadnextcloud-server-6ee7286b419f77ae127257bbbf6a57415678076c.tar.gz
nextcloud-server-6ee7286b419f77ae127257bbbf6a57415678076c.zip
Fix tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--apps/user_ldap/tests/LDAPProviderTest.php10
-rw-r--r--tests/lib/Files/Config/UserMountCacheTest.php3
-rw-r--r--tests/lib/Files/Storage/Wrapper/EncryptionTest.php7
-rw-r--r--tests/lib/Files/Stream/EncryptionTest.php3
4 files changed, 14 insertions, 9 deletions
diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php
index 8df527e0dd8..1d540c42557 100644
--- a/apps/user_ldap/tests/LDAPProviderTest.php
+++ b/apps/user_ldap/tests/LDAPProviderTest.php
@@ -25,10 +25,12 @@
namespace OCA\User_LDAP\Tests;
+use OC\User\Manager;
use OCA\User_LDAP\IGroupLDAP;
use OCP\IConfig;
use OCP\IServerContainer;
use OCA\User_LDAP\IUserLDAP;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Class LDAPProviderTest
@@ -60,21 +62,21 @@ class LDAPProviderTest extends \Test\TestCase {
$server->expects($this->any())
->method($this->anything())
->willReturnSelf();
-
+
return $server;
}
private function getUserManagerMock(IUserLDAP $userBackend) {
- $userManager = $this->getMockBuilder('OC\User\Manager')
+ $userManager = $this->getMockBuilder(Manager::class)
->setMethods(['getBackends'])
- ->setConstructorArgs([$this->createMock(IConfig::class)])
+ ->setConstructorArgs([$this->createMock(IConfig::class), $this->createMock(EventDispatcherInterface::class)])
->getMock();
$userManager->expects($this->any())
->method('getBackends')
->willReturn([$userBackend]);
return $userManager;
}
-
+
private function getGroupManagerMock(IGroupLDAP $groupBackend) {
$groupManager = $this->getMockBuilder('OC\Group\Manager')
->setMethods(['getBackends'])
diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php
index ddf40a2b5e5..299ec1a4378 100644
--- a/tests/lib/Files/Config/UserMountCacheTest.php
+++ b/tests/lib/Files/Config/UserMountCacheTest.php
@@ -17,6 +17,7 @@ use OC\Files\Storage\Storage;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IUserManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\TestCase;
use Test\Util\User\Dummy;
@@ -44,7 +45,7 @@ class UserMountCacheTest extends TestCase {
public function setUp() {
$this->fileIds = [];
$this->connection = \OC::$server->getDatabaseConnection();
- $this->userManager = new Manager($this->createMock(IConfig::class));
+ $this->userManager = new Manager($this->createMock(IConfig::class), $this->createMock(EventDispatcherInterface::class));
$userBackend = new Dummy();
$userBackend->createUser('u1', '');
$userBackend->createUser('u2', '');
diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
index 22c93ee0a91..70d94ab16e6 100644
--- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
+++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php
@@ -18,6 +18,7 @@ use OCP\Files\Cache\ICache;
use OCP\Files\Mount\IMountPoint;
use OCP\IConfig;
use OCP\ILogger;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Test\Files\Storage\Storage;
class EncryptionTest extends Storage {
@@ -130,7 +131,7 @@ class EncryptionTest extends Storage {
$this->util = $this->getMockBuilder('\OC\Encryption\Util')
->setMethods(['getUidAndFilename', 'isFile', 'isExcluded'])
- ->setConstructorArgs([new View(), new Manager($this->config), $this->groupManager, $this->config, $this->arrayCache])
+ ->setConstructorArgs([new View(), new Manager($this->config, $this->createMock(EventDispatcherInterface::class)), $this->groupManager, $this->config, $this->arrayCache])
->getMock();
$this->util->expects($this->any())
->method('getUidAndFilename')
@@ -558,7 +559,7 @@ class EncryptionTest extends Storage {
->setConstructorArgs(
[
new View(),
- new Manager($this->config),
+ new Manager($this->config, $this->createMock(EventDispatcherInterface::class)),
$this->groupManager,
$this->config,
$this->arrayCache
@@ -627,7 +628,7 @@ class EncryptionTest extends Storage {
->willReturn($exists);
$util = $this->getMockBuilder('\OC\Encryption\Util')
- ->setConstructorArgs([new View(), new Manager($this->config), $this->groupManager, $this->config, $this->arrayCache])
+ ->setConstructorArgs([new View(), new Manager($this->config, $this->createMock(EventDispatcherInterface::class)), $this->groupManager, $this->config, $this->arrayCache])
->getMock();
$cache = $this->getMockBuilder('\OC\Files\Cache\Cache')
diff --git a/tests/lib/Files/Stream/EncryptionTest.php b/tests/lib/Files/Stream/EncryptionTest.php
index d7a5554acfd..3ded6ef91d6 100644
--- a/tests/lib/Files/Stream/EncryptionTest.php
+++ b/tests/lib/Files/Stream/EncryptionTest.php
@@ -7,6 +7,7 @@ use OC\Files\View;
use OC\Memcache\ArrayCache;
use OCP\Files\Cache\ICache;
use OCP\IConfig;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class EncryptionTest extends \Test\TestCase {
@@ -47,7 +48,7 @@ class EncryptionTest extends \Test\TestCase {
$file->expects($this->any())->method('getAccessList')->willReturn([]);
$util = $this->getMockBuilder('\OC\Encryption\Util')
->setMethods(['getUidAndFilename'])
- ->setConstructorArgs([new View(), new \OC\User\Manager($config), $groupManager, $config, $arrayCache])
+ ->setConstructorArgs([new View(), new \OC\User\Manager($config, $this->createMock(EventDispatcherInterface::class)), $groupManager, $config, $arrayCache])
->getMock();
$util->expects($this->any())
->method('getUidAndFilename')