diff options
author | Robin Appelman <robin@icewind.nl> | 2020-07-08 13:58:04 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-07-09 12:33:20 +0000 |
commit | b95ba97d27238fea36deae05dc67a6d825eaf1b9 (patch) | |
tree | 560f03e880158286a112a849451e53b5904afc88 | |
parent | 2ba6879937b13c78b128733f406d9f7c3be7a0bf (diff) | |
download | nextcloud-server-b95ba97d27238fea36deae05dc67a6d825eaf1b9.tar.gz nextcloud-server-b95ba97d27238fea36deae05dc67a6d825eaf1b9.zip |
ensure mounts are scanned during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | tests/lib/TestCase.php | 2 | ||||
-rw-r--r-- | tests/lib/Traits/MountProviderTrait.php | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index b28be47875a..88c5b468543 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -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')) { diff --git a/tests/lib/Traits/MountProviderTrait.php b/tests/lib/Traits/MountProviderTrait.php index 0437157e84f..379d33ea71c 100644 --- a/tests/lib/Traits/MountProviderTrait.php +++ b/tests/lib/Traits/MountProviderTrait.php @@ -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) { |