diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 9b97df22d1685932a7afba2db881b3c78a745dd8..cd4be9acc47169d5f8e0a8ebb1ae652d0288a290 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -281,7 +281,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 
 		$filename = 'tmp-' . time() . '.test';
 
-		$cryptedFile = file_put_contents('crypt://' . $filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
@@ -339,7 +339,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$filename = 'tmp-' . time() . '.test';
 
 		// Save long data as encrypted file using stream wrapper
-		$cryptedFile = file_put_contents('crypt://' . $filename, $this->dataLong . $this->dataLong);
+		$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
@@ -422,7 +422,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$filename = 'tmp-' . time();
 
 		// Save long data as encrypted file using stream wrapper
-		$cryptedFile = file_put_contents('crypt://' . $filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///'. $this->userId . '/files/' . $filename, $this->dataShort);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
@@ -436,7 +436,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		\OC_FileProxy::$enabled = $proxyStatus;
 
 		// Get file decrypted contents
-		$decrypt = file_get_contents('crypt://' . $filename);
+		$decrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
 
 		$this->assertEquals($this->dataShort, $decrypt);
 
@@ -452,13 +452,13 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$filename = 'tmp-' . time();
 
 		// Save long data as encrypted file using stream wrapper
-		$cryptedFile = file_put_contents('crypt://' . $filename, $this->dataLong);
+		$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
 
 		// Get file decrypted contents
-		$decrypt = file_get_contents('crypt://' . $filename);
+		$decrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
 
 		$this->assertEquals($this->dataLong, $decrypt);
 
@@ -635,13 +635,13 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$filename = 'tmp-' . time();
 
 		// Save long data as encrypted file using stream wrapper
-		$cryptedFile = file_put_contents('crypt://' . $filename, $this->dataLong);
+		$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
 
 		// Get file decrypted contents
-		$decrypt = file_get_contents('crypt://' . $filename);
+		$decrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
 
 		$this->assertEquals($this->dataLong, $decrypt);
 
@@ -650,7 +650,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$view->rename($filename, $newFilename);
 
 		// Get file decrypted contents
-		$newDecrypt = file_get_contents('crypt://' . $newFilename);
+		$newDecrypt = file_get_contents('crypt:///'. $this->userId . '/files/' . $newFilename);
 
 		$this->assertEquals($this->dataLong, $newDecrypt);
 
@@ -666,13 +666,13 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$filename = 'tmp-' . time();
 
 		// Save long data as encrypted file using stream wrapper
-		$cryptedFile = file_put_contents('crypt://' . $filename, $this->dataLong);
+		$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
 
 		// Get file decrypted contents
-		$decrypt = file_get_contents('crypt://' . $filename);
+		$decrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
 
 		$this->assertEquals($this->dataLong, $decrypt);
 
@@ -683,7 +683,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$view->rename($filename, $newFolder . '/' . $newFilename);
 
 		// Get file decrypted contents
-		$newDecrypt = file_get_contents('crypt://' . $newFolder . '/' . $newFilename);
+		$newDecrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $newFolder . '/' . $newFilename);
 
 		$this->assertEquals($this->dataLong, $newDecrypt);
 
@@ -704,13 +704,13 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$view->mkdir($folder);
 
 		// Save long data as encrypted file using stream wrapper
-		$cryptedFile = file_put_contents('crypt://' . $folder . $filename, $this->dataLong);
+		$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $folder . $filename, $this->dataLong);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
 
 		// Get file decrypted contents
-		$decrypt = file_get_contents('crypt://' . $folder . $filename);
+		$decrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $folder . $filename);
 
 		$this->assertEquals($this->dataLong, $decrypt);
 
@@ -720,7 +720,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$view->rename($folder, $newFolder);
 
 		// Get file decrypted contents
-		$newDecrypt = file_get_contents('crypt://' . $newFolder . $filename);
+		$newDecrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $newFolder . $filename);
 
 		$this->assertEquals($this->dataLong, $newDecrypt);
 
@@ -736,13 +736,13 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		$filename = 'tmp-' . time();
 
 		// Save long data as encrypted file using stream wrapper
-		$cryptedFile = file_put_contents('crypt://' . $filename, $this->dataLong);
+		$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong);
 
 		// Test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
 
 		// Get file decrypted contents
-		$decrypt = file_get_contents('crypt://' . $filename);
+		$decrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
 
 		$this->assertEquals($this->dataLong, $decrypt);
 
@@ -755,7 +755,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
 		OCA\Encryption\Hooks::login($params);
 
 		// Get file decrypted contents
-		$newDecrypt = file_get_contents('crypt://' . $filename);
+		$newDecrypt = file_get_contents('crypt:///' . $this->userId . '/files/' . $filename);
 
 		$this->assertEquals($this->dataLong, $newDecrypt);
 
diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php
index b644856d95d35df68af1c6e29abcd1a92a52d915..9a780d4587c35ec2edff21a00921309045449986 100644
--- a/apps/files_encryption/tests/keymanager.php
+++ b/apps/files_encryption/tests/keymanager.php
@@ -233,7 +233,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
 		\OC_FileProxy::$enabled = true;
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt:///folder1/subfolder/subsubfolder/' . $filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt://'.'/'.Test_Encryption_Keymanager::TEST_USER.'files//folder1/subfolder/subsubfolder/' . $filename, $this->dataShort);
 
 		// test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index ebf678da78ed2f7f536da7db852c47b34e8a3972..987d250cf0a05909850b7ae78f89da23e0614a1a 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -136,7 +136,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 		\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt://' . $this->filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
 
 		// test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
@@ -293,7 +293,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 			. $this->subsubfolder);
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt://' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
+		$cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/'  . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
 										 . $this->filename, $this->dataShort);
 
 		// test that data was successfully written
@@ -499,7 +499,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 		\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt://' . $this->filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/'  . $this->filename, $this->dataShort);
 
 		// test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
@@ -540,7 +540,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 		\OC_User::setUserId(false);
 
 		// get file contents
-		$retrievedCryptedFile = file_get_contents('crypt://' . $this->filename);
+		$retrievedCryptedFile = file_get_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/'  . $this->filename);
 
 		// check if data is the same as we previously written
 		$this->assertEquals($this->dataShort, $retrievedCryptedFile);
@@ -575,7 +575,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 		\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt://' . $this->filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
 
 		// test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
@@ -675,8 +675,8 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 			. $this->subsubfolder);
 
 		// save file with content
-		$cryptedFile1 = file_put_contents('crypt://' . $this->filename, $this->dataShort);
-		$cryptedFile2 = file_put_contents('crypt://' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
+		$cryptedFile1 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+		$cryptedFile2 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
 										  . $this->filename, $this->dataShort);
 
 		// test that data was successfully written
@@ -777,8 +777,8 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 			. $this->subsubfolder);
 
 		// save file with content
-		$cryptedFile1 = file_put_contents('crypt://' . $this->filename, $this->dataShort);
-		$cryptedFile2 = file_put_contents('crypt://' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
+		$cryptedFile1 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
+		$cryptedFile2 = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/'
 										  . $this->filename, $this->dataShort);
 
 		// test that data was successfully written
@@ -811,9 +811,9 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 		\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, false, 'test');
 
 		// get file contents
-		$retrievedCryptedFile1 = file_get_contents('crypt://' . $this->filename);
+		$retrievedCryptedFile1 = file_get_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename);
 		$retrievedCryptedFile2 = file_get_contents(
-			'crypt://' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/' . $this->filename);
+			'crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/' . $this->filename);
 
 		// check if data is the same as we previously written
 		$this->assertEquals($this->dataShort, $retrievedCryptedFile1);
@@ -854,7 +854,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
 		\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt://' . $this->filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1 . '/files/' . $this->filename, $this->dataShort);
 
 		// test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php
index ade968fbece43f931b02a65c29ef30280de59ea7..67854bd80d52c4e22daed128a93d0fcd8bdd0840 100755
--- a/apps/files_encryption/tests/trashbin.php
+++ b/apps/files_encryption/tests/trashbin.php
@@ -122,7 +122,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
 		$filename = 'tmp-' . time() . '.txt';
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt:///' . $filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///' .$this->userId. '/files/'. $filename, $this->dataShort);
 
 		// test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
@@ -223,10 +223,10 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
 	function testPermanentDeleteFile() {
 
 		// generate filename
-		$filename = 'tmp-' . time() . '.txt';
+		$filename = '/tmp-' . time() . '.txt';
 
 		// save file with content
-		$cryptedFile = file_put_contents('crypt:///' . $filename, $this->dataShort);
+		$cryptedFile = file_put_contents('crypt:///' .$this->userId. '/files/' . $filename, $this->dataShort);
 
 		// test that data was successfully written
 		$this->assertTrue(is_int($cryptedFile));
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php
index 1d406789f0c1ac0b1bc1aa9a4d5c8d9efbae4d5e..9268bf2c25f1649e79f5cd48e47e24a3d221ee16 100755
--- a/apps/files_encryption/tests/webdav.php
+++ b/apps/files_encryption/tests/webdav.php
@@ -153,7 +153,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
 		$this->assertTrue(Encryption\Crypt::isCatfileContent($encryptedContent));
 
 		// get decrypted file contents
-		$decrypt = file_get_contents('crypt://' . $filename);
+		$decrypt = file_get_contents('crypt:///' . $this->userId . '/files'. $filename);
 
 		// check if file content match with the written content
 		$this->assertEquals($this->dataShort, $decrypt);