diff --git a/tests/lib/cache/file.php b/tests/lib/cache/file.php
index 54e60e6569ddf623500d748d697bd2d2ac0a3fbe..c33c513fcff2198b8e04213c3b4214222a2b70ad 100644
--- a/tests/lib/cache/file.php
+++ b/tests/lib/cache/file.php
@@ -30,8 +30,10 @@ class Test_Cache_File extends Test_Cache {
 		OC_FileProxy::clearProxies();
 		OC_Hook::clear('OC_Filesystem');
 		
-		//enable only the encryption hook
-		OC_FileProxy::register(new OC_FileProxy_Encryption());
+		//enable only the encryption hook if needed
+		if(OC_App::isEnabled('files_encryption')){
+			OC_FileProxy::register(new OC_FileProxy_Encryption());
+		}
 		
 		//set up temporary storage
 		OC_Filesystem::clearMounts();