diff options
Diffstat (limited to 'tests/lib/files/cache/updater.php')
-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 d8414dadbec..e3d3aae818d 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -22,6 +22,8 @@ class Updater extends \PHPUnit_Framework_TestCase { */ private $scanner; + private $stateFilesEncryption; + /** * @var \OC\Files\Cache\Cache $cache */ @@ -30,6 +32,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'); @@ -47,6 +55,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(); @@ -64,7 +76,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() { |