summaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-10-24 16:33:03 +0200
committerGitHub <noreply@github.com>2017-10-24 16:33:03 +0200
commitb1f77aca4effec99387481a831910d4870ae2ffc (patch)
tree401d6dcd8dc97e0de6cb5cc78d8669bca28c93a8 /apps/encryption/tests
parent306d4e1d40ce076b715a5f0a87e743189da775e6 (diff)
parent99934134dc53baaee56740de669c7df549317a2f (diff)
downloadnextcloud-server-b1f77aca4effec99387481a831910d4870ae2ffc.tar.gz
nextcloud-server-b1f77aca4effec99387481a831910d4870ae2ffc.zip
Merge pull request #6919 from nextcloud/di-appmanager-encryption-migration
Use DI for IAppManager to encryption migration
Diffstat (limited to 'apps/encryption/tests')
-rw-r--r--apps/encryption/tests/MigrationTest.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/encryption/tests/MigrationTest.php b/apps/encryption/tests/MigrationTest.php
index 595d7f12067..8f168e31e4d 100644
--- a/apps/encryption/tests/MigrationTest.php
+++ b/apps/encryption/tests/MigrationTest.php
@@ -203,13 +203,14 @@ class MigrationTest extends \Test\TestCase {
$this->createDummySystemWideKeys();
/** @var \PHPUnit_Framework_MockObject_MockObject|\OCA\Encryption\Migration $m */
- $m = $this->getMockBuilder('OCA\Encryption\Migration')
+ $m = $this->getMockBuilder(Migration::class)
->setConstructorArgs(
[
\OC::$server->getConfig(),
new \OC\Files\View(),
\OC::$server->getDatabaseConnection(),
- $this->logger
+ $this->logger,
+ \OC::$server->getAppManager()
]
)->setMethods(['getSystemMountPoints'])->getMock();
@@ -366,7 +367,7 @@ class MigrationTest extends \Test\TestCase {
public function testUpdateDB() {
$this->prepareDB();
- $m = new Migration(\OC::$server->getConfig(), new \OC\Files\View(), \OC::$server->getDatabaseConnection(), $this->logger);
+ $m = new Migration(\OC::$server->getConfig(), new \OC\Files\View(), \OC::$server->getDatabaseConnection(), $this->logger, \OC::$server->getAppManager());
$this->invokePrivate($m, 'installedVersion', ['0.7']);
$m->updateDB();
@@ -386,7 +387,7 @@ class MigrationTest extends \Test\TestCase {
$config->setAppValue('encryption', 'publicShareKeyId', 'wrong_share_id');
$config->setUserValue(self::TEST_ENCRYPTION_MIGRATION_USER1, 'encryption', 'recoverKeyEnabled', '9');
- $m = new Migration(\OC::$server->getConfig(), new \OC\Files\View(), \OC::$server->getDatabaseConnection(), $this->logger);
+ $m = new Migration(\OC::$server->getConfig(), new \OC\Files\View(), \OC::$server->getDatabaseConnection(), $this->logger, \OC::$server->getAppManager());
$this->invokePrivate($m, 'installedVersion', ['0.7']);
$m->updateDB();
@@ -455,7 +456,7 @@ class MigrationTest extends \Test\TestCase {
*/
public function testUpdateFileCache() {
$this->prepareFileCache();
- $m = new Migration(\OC::$server->getConfig(), new \OC\Files\View(), \OC::$server->getDatabaseConnection(), $this->logger);
+ $m = new Migration(\OC::$server->getConfig(), new \OC\Files\View(), \OC::$server->getDatabaseConnection(), $this->logger, \OC::$server->getAppManager());
$this->invokePrivate($m, 'installedVersion', ['0.7']);
self::invokePrivate($m, 'updateFileCache');
@@ -527,13 +528,14 @@ class MigrationTest extends \Test\TestCase {
->disableOriginalConstructor()->getMock();
$view->expects($this->any())->method('file_exists')->willReturn(true);
- $m = $this->getMockBuilder('OCA\Encryption\Migration')
+ $m = $this->getMockBuilder(Migration::class)
->setConstructorArgs(
[
\OC::$server->getConfig(),
$view,
\OC::$server->getDatabaseConnection(),
- $this->logger
+ $this->logger,
+ \OC::$server->getAppManager()
]
)->setMethods(['getSystemMountPoints'])->getMock();