[Pkg-owncloud-commits] [owncloud] 13/103: Revert "Revert "[stable8] Properly add trailing slash to mount point""

David Prévot taffit at moszumanska.debian.org
Sun May 31 12:32:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.4RC1
in repository owncloud.

commit 0f314ce4551c1fdd99514ac844d0bcb72077ffa8
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Thu Apr 16 11:03:01 2015 +0200

    Revert "Revert "[stable8] Properly add trailing slash to mount point""
---
 apps/files_sharing/tests/sharedmount.php | 12 +++++++++---
 lib/private/files/mount/mountpoint.php   |  4 +++-
 tests/lib/files/mount/mountpoint.php     |  4 ++++
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/apps/files_sharing/tests/sharedmount.php b/apps/files_sharing/tests/sharedmount.php
index 715c22c..33fee2b 100644
--- a/apps/files_sharing/tests/sharedmount.php
+++ b/apps/files_sharing/tests/sharedmount.php
@@ -141,14 +141,20 @@ class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase {
 
 		self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
 
-		\OC\Files\Filesystem::rename($this->filename, "newFileName");
+		\OC\Files\Filesystem::rename($this->filename, $this->filename . '_renamed');
 
-		$this->assertTrue(\OC\Files\Filesystem::file_exists('newFileName'));
+		$this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename . '_renamed'));
 		$this->assertFalse(\OC\Files\Filesystem::file_exists($this->filename));
 
 		self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
 		$this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename));
-		$this->assertFalse(\OC\Files\Filesystem::file_exists("newFileName"));
+		$this->assertFalse(\OC\Files\Filesystem::file_exists($this->filename . '_renamed'));
+
+		// rename back to original name
+		self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
+		\OC\Files\Filesystem::rename($this->filename . '_renamed', $this->filename);
+		$this->assertFalse(\OC\Files\Filesystem::file_exists($this->filename . '_renamed'));
+		$this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename));
 
 		//cleanup
 		\OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2);
diff --git a/lib/private/files/mount/mountpoint.php b/lib/private/files/mount/mountpoint.php
index 85edb7c..b62dc47 100644
--- a/lib/private/files/mount/mountpoint.php
+++ b/lib/private/files/mount/mountpoint.php
@@ -95,10 +95,12 @@ class MountPoint implements IMountPoint {
 	}
 
 	/**
+	 * Sets the mount point path, relative to data/
+	 *
 	 * @param string $mountPoint new mount point
 	 */
 	public function setMountPoint($mountPoint) {
-		$this->mountPoint = $mountPoint;
+		$this->mountPoint = $this->formatPath($mountPoint);
 	}
 
 	/**
diff --git a/tests/lib/files/mount/mountpoint.php b/tests/lib/files/mount/mountpoint.php
index 5a9c6de..29610e6 100644
--- a/tests/lib/files/mount/mountpoint.php
+++ b/tests/lib/files/mount/mountpoint.php
@@ -31,6 +31,10 @@ class MountPoint extends \Test\TestCase {
 
 		$this->assertEquals($storage, $mountPoint->getStorage());
 		$this->assertEquals(123, $mountPoint->getStorageId());
+		$this->assertEquals('/mountpoint/', $mountPoint->getMountPoint());
+
+		$mountPoint->setMountPoint('another');
+		$this->assertEquals('/another/', $mountPoint->getMountPoint());
 	}
 
 	public function testInvalidStorage() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list