aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/files/view.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2015-03-19 16:20:38 +0100
committerRobin Appelman <robin@icewind.nl>2015-03-19 16:20:38 +0100
commit73874ca27f102b40f40df70367e01a4045a17b3e (patch)
tree7f92975f05831748d873a5dec4c259100e51fbf0 /tests/lib/files/view.php
parentbe6edd465a5a77ea859661feaedbeacd5a66f9db (diff)
parent7ab919256b066970a0a7139ab19bcdae5773c036 (diff)
downloadnextcloud-server-73874ca27f102b40f40df70367e01a4045a17b3e.tar.gz
nextcloud-server-73874ca27f102b40f40df70367e01a4045a17b3e.zip
Merge pull request #14704 from owncloud/storage-wrapper-mount
pass mountpoint to storage wrapper callback
Diffstat (limited to 'tests/lib/files/view.php')
-rw-r--r--tests/lib/files/view.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index db39df7d16b..cd9f2d4afd1 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -8,6 +8,7 @@
namespace Test\Files;
use OC\Files\Cache\Watcher;
+use OC\Files\Mount\MountPoint;
use OC\Files\Storage\Temporary;
class TemporaryNoTouch extends \OC\Files\Storage\Temporary {
@@ -975,4 +976,21 @@ class View extends \Test\TestCase {
$view = new \OC\Files\View('');
$this->assertTrue($view->rename('/test/foo.txt', '/test/foo/bar.txt'));
}
+
+ public function testSetMountOptionsInStorage() {
+ $mount = new MountPoint('\OC\Files\Storage\Temporary', '/asd/', [[]], \OC\Files\Filesystem::getLoader(), ['foo' => 'bar']);
+ \OC\Files\Filesystem::getMountManager()->addMount($mount);
+ /** @var \OC\Files\Storage\Common $storage */
+ $storage = $mount->getStorage();
+ $this->assertEquals($storage->getMountOption('foo'), 'bar');
+ }
+
+ public function testSetMountOptionsWatcherPolicy() {
+ $mount = new MountPoint('\OC\Files\Storage\Temporary', '/asd/', [[]], \OC\Files\Filesystem::getLoader(), ['filesystem_check_changes' => Watcher::CHECK_NEVER]);
+ \OC\Files\Filesystem::getMountManager()->addMount($mount);
+ /** @var \OC\Files\Storage\Common $storage */
+ $storage = $mount->getStorage();
+ $watcher = $storage->getWatcher();
+ $this->assertEquals(Watcher::CHECK_NEVER, $watcher->getPolicy());
+ }
}