summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-22 17:25:40 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-22 17:25:40 +0200
commit8c7c713e86ed144b1a5e80ea27fdba4744b6d09d (patch)
tree298b4e499f2ac435e931fe683ee522651145c99c /tests
parente37b95ae53d098ffa93018e90d2443867f047a4f (diff)
parent13c01e62cf9cd1d241b447b80fda719fb2df9931 (diff)
downloadnextcloud-server-8c7c713e86ed144b1a5e80ea27fdba4744b6d09d.tar.gz
nextcloud-server-8c7c713e86ed144b1a5e80ea27fdba4744b6d09d.zip
Merge pull request #24187 from owncloud/fs-initmountpoint-rethrowifusernotfoundagain
Mark $usersSetup only if user was found in initMountPoints
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/filesystem.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php
index 8245af0ace1..b5a3e147259 100644
--- a/tests/lib/files/filesystem.php
+++ b/tests/lib/files/filesystem.php
@@ -342,6 +342,28 @@ class Filesystem extends \Test\TestCase {
}
/**
+ * Tests that an exception is thrown when passed user does not exist.
+ */
+ public function testLocalMountWhenUserDoesNotExistTwice() {
+ $thrown = 0;
+ $userId = $this->getUniqueID('user_');
+
+ try {
+ \OC\Files\Filesystem::initMountPoints($userId);
+ } catch (NoUserException $e) {
+ $thrown++;
+ }
+
+ try {
+ \OC\Files\Filesystem::initMountPoints($userId);
+ } catch (NoUserException $e) {
+ $thrown++;
+ }
+
+ $this->assertEquals(2, $thrown);
+ }
+
+ /**
* Tests that the home storage is used for the user's mount point
*/
public function testHomeMount() {