create new mounts every time the mount provider is called

important for storage wrappers
This commit is contained in:
Robin Appelman 2015-09-08 15:34:18 +02:00 committed by Thomas Müller
parent 5247a0685d
commit e3e78f809d
1 changed files with 4 additions and 2 deletions

View File

@ -32,7 +32,7 @@ trait MountProviderTrait {
if (!isset($this->mounts[$userId])) { if (!isset($this->mounts[$userId])) {
$this->mounts[$userId] = []; $this->mounts[$userId] = [];
} }
$this->mounts[$userId][] = new MountPoint($storage, $mountPoint, $arguments, $this->storageFactory); $this->mounts[$userId][] = ['storage' => $storage, 'mountPoint' => $mountPoint, 'arguments' => $arguments];
} }
protected function registerStorageWrapper($name, $wrapper) { protected function registerStorageWrapper($name, $wrapper) {
@ -46,7 +46,9 @@ trait MountProviderTrait {
->method('getMountsForUser') ->method('getMountsForUser')
->will($this->returnCallback(function (IUser $user) { ->will($this->returnCallback(function (IUser $user) {
if (isset($this->mounts[$user->getUID()])) { if (isset($this->mounts[$user->getUID()])) {
return $this->mounts[$user->getUID()]; return array_map(function ($config) {
return new MountPoint($config['storage'], $config['mountPoint'], $config['arguments'], $this->storageFactory);
}, $this->mounts[$user->getUID()]);
} else { } else {
return []; return [];
} }