diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-29 15:08:12 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-29 15:08:12 +0100 |
commit | fcfac51aa18bdd81be004e63fb98683e2cc780a0 (patch) | |
tree | 3ea5b8896fc502bdb2d443dd34dc203d9ef06834 /tests | |
parent | b0b76fe064860d2074c91897a29e0f9ac5705db8 (diff) | |
download | nextcloud-server-fcfac51aa18bdd81be004e63fb98683e2cc780a0.tar.gz nextcloud-server-fcfac51aa18bdd81be004e63fb98683e2cc780a0.zip |
backport of https://github.com/owncloud/core/pull/5513
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/updater.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index 5d7997b0544..9c1c6f8d18f 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -21,6 +21,8 @@ class Updater extends \PHPUnit_Framework_TestCase { */ private $scanner; + private $stateFilesEncryption; + /** * @var \OC\Files\Cache\Cache $cache */ @@ -29,6 +31,12 @@ class Updater extends \PHPUnit_Framework_TestCase { private static $user; public function setUp() { + + // remember files_encryption state + $this->stateFilesEncryption = \OC_App::isEnabled('files_encryption'); + // we want to tests with the encryption app disabled + \OC_App::disable('files_encryption'); + $this->storage = new \OC\Files\Storage\Temporary(array()); $textData = "dummy file data\n"; $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png'); @@ -46,6 +54,10 @@ class Updater extends \PHPUnit_Framework_TestCase { if (!self::$user) { self::$user = uniqid(); } + + \OC_User::createUser(self::$user, 'password'); + \OC_User::setUserId(self::$user); + \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files'); Filesystem::clearMounts(); @@ -63,7 +75,13 @@ class Updater extends \PHPUnit_Framework_TestCase { if ($this->cache) { $this->cache->clear(); } + $result = \OC_User::deleteUser(self::$user); + $this->assertTrue($result); Filesystem::tearDown(); + // reset app files_encryption + if ($this->stateFilesEncryption) { + \OC_App::enable('files_encryption'); + } } public function testWrite() { |