From f722640a32a6c0a7fb0232abf8f57052d43d19c9 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 28 Oct 2016 09:07:40 +0200 Subject: Proper DI of config * Fixed comments Signed-off-by: Roeland Jago Douma --- tests/lib/Files/Config/UserMountCacheTest.php | 3 ++- tests/lib/Files/Storage/Wrapper/EncryptionTest.php | 6 +++--- tests/lib/Files/Stream/EncryptionTest.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/lib/Files') diff --git a/tests/lib/Files/Config/UserMountCacheTest.php b/tests/lib/Files/Config/UserMountCacheTest.php index 51d488e6dee..376f0a0276c 100644 --- a/tests/lib/Files/Config/UserMountCacheTest.php +++ b/tests/lib/Files/Config/UserMountCacheTest.php @@ -13,6 +13,7 @@ use OC\Files\Mount\MountPoint; use OC\Log; use OC\User\Manager; use OCP\Files\Config\ICachedMountInfo; +use OCP\IConfig; use OCP\IDBConnection; use OCP\IUserManager; use Test\TestCase; @@ -42,7 +43,7 @@ class UserMountCacheTest extends TestCase { public function setUp() { $this->fileIds = []; $this->connection = \OC::$server->getDatabaseConnection(); - $this->userManager = new Manager(null); + $this->userManager = new Manager($this->createMock(IConfig::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 55b38d546de..245f39f5e2e 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -121,7 +121,7 @@ class EncryptionTest extends Storage { $this->util = $this->getMockBuilder('\OC\Encryption\Util') ->setMethods(['getUidAndFilename', 'isFile', 'isExcluded']) - ->setConstructorArgs([new View(), new Manager(), $this->groupManager, $this->config, $this->arrayCache]) + ->setConstructorArgs([new View(), new Manager($this->config), $this->groupManager, $this->config, $this->arrayCache]) ->getMock(); $this->util->expects($this->any()) ->method('getUidAndFilename') @@ -547,7 +547,7 @@ class EncryptionTest extends Storage { ->setConstructorArgs( [ new View(), - new Manager(), + new Manager($this->config), $this->groupManager, $this->config, $this->arrayCache @@ -612,7 +612,7 @@ class EncryptionTest extends Storage { ->disableOriginalConstructor()->getMock(); $util = $this->getMockBuilder('\OC\Encryption\Util') - ->setConstructorArgs([new View(), new Manager(), $this->groupManager, $this->config, $this->arrayCache]) + ->setConstructorArgs([new View(), new Manager($this->config), $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 6f3c879f9e6..e072dd6718d 100644 --- a/tests/lib/Files/Stream/EncryptionTest.php +++ b/tests/lib/Files/Stream/EncryptionTest.php @@ -43,7 +43,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(), $groupManager, $config, $arrayCache]) + ->setConstructorArgs([new View(), new \OC\User\Manager($config), $groupManager, $config, $arrayCache]) ->getMock(); $util->expects($this->any()) ->method('getUidAndFilename') -- cgit v1.2.3