]> source.dussan.org Git - nextcloud-server.git/commitdiff
ensure mounts are scanned during tests
authorRobin Appelman <robin@icewind.nl>
Wed, 8 Jul 2020 11:58:04 +0000 (13:58 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 9 Jul 2020 09:14:44 +0000 (11:14 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
tests/lib/TestCase.php
tests/lib/Traits/MountProviderTrait.php

index b28be47875a3a4b84cf86c20d648d6eb799922eb..88c5b468543ffb22a8661c8474ade1fc60c513aa 100644 (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')) {
index 0437157e84ff71390f26570c1c2d20c1e6ca4824..379d33ea71c171389371930749b0bc2df1c86395 100644 (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) {