ensure mounts are scanned during tests

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-07-08 13:58:04 +02:00 committed by backportbot[bot]
parent 2ba6879937
commit b95ba97d27
2 changed files with 7 additions and 1 deletions

View File

@ -441,7 +441,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
}
}
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')) {

View File

@ -33,6 +33,12 @@ trait MountProviderTrait {
$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) {