Skip to content

Commit

Permalink
ensure mounts are scanned during tests
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and rullzer committed Jul 9, 2020
1 parent 1d88ac6 commit 367da7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/lib/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ protected function isFileLocked($view, $path, $type, $onMountPoint = false) {
}
}

private function IsDatabaseAccessAllowed() {
protected function IsDatabaseAccessAllowed() {
// on travis-ci.org we allow database access in any case - otherwise
// this will break all apps right away
if (true == getenv('TRAVIS')) {
Expand Down
6 changes: 6 additions & 0 deletions tests/lib/Traits/MountProviderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ protected function registerMount($userId, $storage, $mountPoint, $arguments = nu
$this->mounts[$userId] = [];
}
$this->mounts[$userId][] = ['storage' => $storage, 'mountPoint' => $mountPoint, 'arguments' => $arguments];

if ($this->IsDatabaseAccessAllowed()) {
$mount = new MountPoint($storage, $mountPoint, $arguments, $this->storageFactory);
$storage = $mount->getStorage();
$storage->getScanner()->scan('');
}
}

protected function registerStorageWrapper($name, $wrapper) {
Expand Down

0 comments on commit 367da7e

Please sign in to comment.