[Pkg-owncloud-commits] [owncloud] 36/59: Add unit test for multi-user configuration loading
David Prévot
taffit at moszumanska.debian.org
Fri Jul 18 16:19:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 4fa39283f6765baad4707381a07d06d7890c5367
Author: Robin McCorkell <rmccorkell at karoshi.org.uk>
Date: Tue Jul 15 18:39:09 2014 +0100
Add unit test for multi-user configuration loading
---
apps/files_external/tests/mountconfig.php | 37 +++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php
index 9b04e20..5f958e0 100644
--- a/apps/files_external/tests/mountconfig.php
+++ b/apps/files_external/tests/mountconfig.php
@@ -800,4 +800,41 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
$this->assertEquals($priority,
$mountPoints['/'.self::TEST_USER1.'/files/ext']['priority']);
}
+
+ /*
+ * Test for correct personal configuration loading in file sharing scenarios
+ */
+ public function testMultiUserPersonalConfigLoading() {
+ $mountConfig = array(
+ 'host' => 'somehost',
+ 'user' => 'someuser',
+ 'password' => 'somepassword',
+ 'root' => 'someroot'
+ );
+
+ // Create personal mount point
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $mountConfig,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER1,
+ true
+ )
+ );
+
+ // Ensure other user can read mount points
+ \OC_User::setUserId(self::TEST_USER2);
+ $mountPointsMe = OC_Mount_Config::getAbsoluteMountPoints(self::TEST_USER2);
+ $mountPointsOther = OC_Mount_Config::getAbsoluteMountPoints(self::TEST_USER1);
+
+ $this->assertEquals(0, count($mountPointsMe));
+ $this->assertEquals(1, count($mountPointsOther));
+ $this->assertTrue(isset($mountPointsOther['/'.self::TEST_USER1.'/files/ext']));
+ $this->assertEquals('\OC\Files\Storage\SMB',
+ $mountPointsOther['/'.self::TEST_USER1.'/files/ext']['class']);
+ $this->assertEquals($mountConfig,
+ $mountPointsOther['/'.self::TEST_USER1.'/files/ext']['options']);
+ }
}
--
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