diff options
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/files/filesystem.php | 22 |
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() { |