Browse Source
ensure mounts are scanned during tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/21489/head
Robin Appelman
5 years ago
committed by
Roeland Jago Douma
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with
7 additions and
1 deletions
-
tests/lib/TestCase.php
-
tests/lib/Traits/MountProviderTrait.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')) { |
|
|
|
|
|
@ -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) { |
|
|
|