summaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2014-02-20 09:53:52 +0100
committerLukas Reschke <lukas@statuscode.ch>2014-02-20 09:53:52 +0100
commit38d6c562495a1f8afdc9ee83c00dfa96ebe52edc (patch)
tree4d743f0caf807973178a63c0b2f628556b7106ae /apps/files_external/tests
parenta4f71267f0c7ef7a2a8d23ac0a47279ed8bdda5e (diff)
parent9e9a5b9ea1f9b4699cf2d0c621f3f911f3639df9 (diff)
downloadnextcloud-server-38d6c562495a1f8afdc9ee83c00dfa96ebe52edc.tar.gz
nextcloud-server-38d6c562495a1f8afdc9ee83c00dfa96ebe52edc.zip
Merge pull request #7294 from owncloud/extstorage-configclass
Added extra checks for ext storage class
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r--apps/files_external/tests/mountconfig.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php
index 941aec680bb..4c61b8961f3 100644
--- a/apps/files_external/tests/mountconfig.php
+++ b/apps/files_external/tests/mountconfig.php
@@ -48,4 +48,28 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
$this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
}
+
+ public function testAddMountPointSingleUser() {
+ \OC_User::setUserId('test');
+ $mountType = 'user';
+ $applicable = 'test';
+ $isPersonal = true;
+ // local
+ $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\storage\local', array(), $mountType, $applicable, $isPersonal));
+ // non-local
+ $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal));
+
+ }
+
+ public function testAddMountPointUnexistClass() {
+ \OC_User::setUserId('test');
+ $storageClass = 'Unexist_Storage';
+ $mountType = 'user';
+ $applicable = 'test';
+ $isPersonal = true;
+ // local
+ // non-local
+ $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', $storageClass, array(), $mountType, $applicable, $isPersonal));
+
+ }
}