Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-11-22 19:15:50 +0300
committerGitHub <noreply@github.com>2016-11-22 19:15:50 +0300
commitf118ac6e3783218d4d942c96a37ee06c9593bacf (patch)
tree3016ebdbb9dfba2b28d18e3c8b2ab83d69ff0ac3 /tests
parentd886da7a68321e699bb22a38ec9748b983ef290e (diff)
parent8d6a7b756ba5dd8dc7379589962d6fbd8231ee90 (diff)
Merge pull request #26600 from owncloud/stable9.1-d1c844093539a2d0bf89fd5068e85448c11a8be9
[stable9.1] Skip local shares in bkg scan and occ files:scan (#26590)
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/Utils/ScannerTest.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/lib/Files/Utils/ScannerTest.php b/tests/lib/Files/Utils/ScannerTest.php
index 0c8e41c24c7..a71005cdec3 100644
--- a/tests/lib/Files/Utils/ScannerTest.php
+++ b/tests/lib/Files/Utils/ScannerTest.php
@@ -187,4 +187,26 @@ class ScannerTest extends \Test\TestCase {
$this->assertNotEquals($oldRoot->getEtag(), $newRoot->getEtag());
}
+
+ public function testSkipLocalShares() {
+ $sharedStorage = $this->getMockBuilder('OC\Files\Storage\Shared')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $sharedMount = new MountPoint($sharedStorage, '/share');
+ Filesystem::getMountManager()->addMount($sharedMount);
+
+ $sharedStorage->expects($this->any())
+ ->method('instanceOfStorage')
+ ->will($this->returnValueMap([
+ ['OCA\Files_Sharing\ISharedStorage', true],
+ ]));
+ $sharedStorage->expects($this->never())
+ ->method('getScanner');
+
+ $scanner = new TestScanner('', \OC::$server->getDatabaseConnection(), \OC::$server->getLogger());
+ $scanner->addMount($sharedMount);
+ $scanner->scan('');
+
+ $scanner->backgroundScan('');
+ }
}