diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-01-11 08:16:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-11 08:16:12 +0100 |
commit | f515c6db4a77b0ad1739fa3d0435e392910d59c9 (patch) | |
tree | c5a75e9eb337d2e7b1c6ee695b8efcdaa5432bee /tests | |
parent | a90cbb0f094f0f418c0e6e78dcd406d34f7b3bd2 (diff) | |
parent | 00b17c3af5544b01d7834aa4c8a95c7b3bbf95ca (diff) | |
download | nextcloud-server-f515c6db4a77b0ad1739fa3d0435e392910d59c9.tar.gz nextcloud-server-f515c6db4a77b0ad1739fa3d0435e392910d59c9.zip |
Merge pull request #2745 from nextcloud/oc_26590
[downstream] Skip local shares in bkg scan and occ files:scan (#26590)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Files/Utils/ScannerTest.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/lib/Files/Utils/ScannerTest.php b/tests/lib/Files/Utils/ScannerTest.php index 7895331d615..1379bc2e906 100644 --- a/tests/lib/Files/Utils/ScannerTest.php +++ b/tests/lib/Files/Utils/ScannerTest.php @@ -11,6 +11,7 @@ namespace Test\Files\Utils; use OC\Files\Filesystem; use OC\Files\Mount\MountPoint; use OC\Files\Storage\Temporary; +use OCA\Files_Sharing\SharedStorage; use OCP\Files\Config\IMountProvider; use OCP\Files\Storage\IStorageFactory; use OCP\IUser; @@ -188,4 +189,24 @@ class ScannerTest extends \Test\TestCase { $this->assertNotEquals($oldRoot->getEtag(), $newRoot->getEtag()); } + + public function testSkipLocalShares() { + $sharedStorage = $this->createMock(SharedStorage::class); + $sharedMount = new MountPoint($sharedStorage, '/share'); + Filesystem::getMountManager()->addMount($sharedMount); + + $sharedStorage->expects($this->any()) + ->method('instanceOfStorage') + ->will($this->returnValueMap([ + [SharedStorage::class, true], + ])); + $sharedStorage->expects($this->never()) + ->method('getScanner'); + + $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), \OC::$server->getLogger()); + $scanner->addMount($sharedMount); + $scanner->scan(''); + + $scanner->backgroundScan(''); + } } |