diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-17 13:57:38 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-17 13:57:38 +0200 |
commit | b020e6b30853a3e5b506ce7133bae239c7dc0814 (patch) | |
tree | 46bcf196f65a28b5c7857d0142d4c703eaf78963 /apps/files_external | |
parent | 4de689602854c019ae3a5e4362455dfdf523ac56 (diff) | |
parent | 4fa39283f6765baad4707381a07d06d7890c5367 (diff) | |
download | nextcloud-server-b020e6b30853a3e5b506ce7133bae239c7dc0814.tar.gz nextcloud-server-b020e6b30853a3e5b506ce7133bae239c7dc0814.zip |
Merge pull request #9674 from owncloud/stable7-9647
[stable7] Add unit test for multi-user configuration loading
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/tests/mountconfig.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php index 9b04e200e2b..5f958e00d93 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']); + } } |