]> source.dussan.org Git - nextcloud-server.git/commitdiff
Replace OC_Config in tests with IConfig calls
authorMorris Jobke <hey@morrisjobke.de>
Thu, 3 Dec 2015 08:11:21 +0000 (09:11 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 3 Dec 2015 08:38:41 +0000 (09:38 +0100)
tests/lib/cache/file.php
tests/lib/files/etagtest.php

index 6db5acdf13f9e0a2619e2340314b8f542b4e4aee..7aa969df02ce2263d4f5eb2b633a8b53755e38ab 100644 (file)
@@ -63,8 +63,9 @@ class FileCache extends \Test_Cache {
                $storage = new \OC\Files\Storage\Temporary(array());
                \OC\Files\Filesystem::mount($storage,array(),'/');
                $datadir = str_replace('local::', '', $storage->getId());
-               $this->datadir = \OC_Config::getValue('cachedirectory', \OC::$SERVERROOT.'/data/cache');
-               \OC_Config::setValue('cachedirectory', $datadir);
+               $config = \OC::$server->getConfig();
+               $this->datadir = $config->getSystemValue('cachedirectory', \OC::$SERVERROOT.'/data/cache');
+               $config->setSystemValue('cachedirectory', $datadir);
 
                \OC_User::clearBackends();
                \OC_User::useBackend(new \Test\Util\User\Dummy());
@@ -89,7 +90,7 @@ class FileCache extends \Test_Cache {
                $this->instance->remove('hack', 'hack');
 
                \OC_User::setUserId($this->user);
-               \OC_Config::setValue('cachedirectory', $this->datadir);
+               \OC::$server->getConfig()->setSystemValue('cachedirectory', $this->datadir);
 
                // Restore the original mount point
                \OC\Files\Filesystem::clearMounts();
index 7fbeae88820ccd758b773d6e0cadb29cef4c44a4..c214a3d4da6484ab6ca244efe8db55c5b0d65916 100644 (file)
@@ -37,16 +37,17 @@ class EtagTest extends \Test\TestCase {
                \OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
                \OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
 
-               $this->datadir = \OC_Config::getValue('datadirectory');
+               $config = \OC::$server->getConfig();
+               $this->datadir = $config->getSystemValue('datadirectory');
                $this->tmpDir = \OC_Helper::tmpFolder();
-               \OC_Config::setValue('datadirectory', $this->tmpDir);
+               $config->setSystemValue('datadirectory', $this->tmpDir);
 
                $this->userBackend = new \Test\Util\User\Dummy();
                \OC_User::useBackend($this->userBackend);
        }
 
        protected function tearDown() {
-               \OC_Config::setValue('datadirectory', $this->datadir);
+               \OC::$server->getConfig()->setSystemValue('datadirectory', $this->datadir);
 
                $this->logout();
                parent::tearDown();