summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-07-08 13:58:04 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-07-09 12:33:29 +0000
commit2eb61b4111d4269239c68c4d057192c7bb857a56 (patch)
treef58248649e800826bccb258e15ab9f80a05fdab4
parent52aa0ef3dabffc3b3e921fa07b96f7f315b427dd (diff)
downloadnextcloud-server-2eb61b4111d4269239c68c4d057192c7bb857a56.tar.gz
nextcloud-server-2eb61b4111d4269239c68c4d057192c7bb857a56.zip
ensure mounts are scanned during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--tests/lib/TestCase.php2
-rw-r--r--tests/lib/Traits/MountProviderTrait.php6
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index b80e720efd3..40ba26a895c 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) {