From f36ee69855384f0a42e745efad337a2155909f9a Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Fri, 15 Nov 2013 16:49:50 +0100
Subject: [PATCH] tests added

---
 apps/files_encryption/tests/helper.php | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/apps/files_encryption/tests/helper.php b/apps/files_encryption/tests/helper.php
index 067fc763a9..cd2be70a8f 100644
--- a/apps/files_encryption/tests/helper.php
+++ b/apps/files_encryption/tests/helper.php
@@ -51,4 +51,17 @@ class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
 		$this->assertEquals('testfile.txt', Encryption\Helper::stripPartialFileExtension($filename));
 	}
 
-}
\ No newline at end of file
+	function testGetPathToRealFile() {
+
+		// the relative path to /user/files/ that's what we want to get from getPathToRealFile()
+		$relativePath = "foo/bar/test.txt";
+
+		// test paths
+		$versionPath = "/user/files_versions/foo/bar/test.txt.v456756835";
+		$cachePath = "/user/cache/transferid636483/foo/bar/test.txt";
+
+		$this->assertEquals($relativePath, Encryption\Helper::getPathToRealFile($versionPath));
+		$this->assertEquals($relativePath, Encryption\Helper::getPathToRealFile($cachePath));
+	}
+
+}
-- 
GitLab