diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-10-09 20:46:43 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-10-09 20:46:43 +0200 |
commit | 7f8eeb04747e88770a9eb49dffa028a36ab6cadc (patch) | |
tree | 0ad4e54bc758689b576acb51996bb5975d420163 /tests | |
parent | 3a3819b30392547d6d4250830275cec64f7a08d4 (diff) | |
download | nextcloud-server-7f8eeb04747e88770a9eb49dffa028a36ab6cadc.tar.gz nextcloud-server-7f8eeb04747e88770a9eb49dffa028a36ab6cadc.zip |
ensure the view's root is a subfolder of the the default root, not only starting the same
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/view.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 3043f132b73..e2107a03614 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -391,4 +391,22 @@ class View extends \PHPUnit_Framework_TestCase { $this->storages[] = $storage; return $storage; } + + /** + * @medium + */ + function testViewHooksIfRootStartsTheSame() { + $storage1 = $this->getTestStorage(); + $storage2 = $this->getTestStorage(); + $defaultRoot = \OC\Files\Filesystem::getRoot(); + \OC\Files\Filesystem::mount($storage1, array(), '/'); + \OC\Files\Filesystem::mount($storage2, array(), $defaultRoot . '_substorage'); + \OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook'); + + $subView = new \OC\Files\View($defaultRoot . '_substorage'); + $this->hookPath = null; + + $subView->file_put_contents('/foo.txt', 'asd'); + $this->assertNull($this->hookPath); + } } |