summaryrefslogtreecommitdiffstats
path: root/tests/lib/files/view.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-09-22 01:23:18 +0200
committerRobin Appelman <icewind@owncloud.com>2013-09-22 01:24:12 +0200
commita1d4eb1f956148fe9002dd17bdfef3bd66063bf0 (patch)
treee0fb4b9afb432aa6cf997bda3b91bf2c818c4ad2 /tests/lib/files/view.php
parent5b95e7aa0f0487d7ddb07588c71d25cd973c2bb6 (diff)
downloadnextcloud-server-a1d4eb1f956148fe9002dd17bdfef3bd66063bf0.tar.gz
nextcloud-server-a1d4eb1f956148fe9002dd17bdfef3bd66063bf0.zip
files: when filtering search results, ensure results are children of the fakeroot not just path starting the same
Diffstat (limited to 'tests/lib/files/view.php')
-rw-r--r--tests/lib/files/view.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 0de436f570a..3043f132b73 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -354,8 +354,22 @@ class View extends \PHPUnit_Framework_TestCase {
$this->hookPath = $params['path'];
}
+ public function testSearchNotOutsideView() {
+ $storage1 = $this->getTestStorage();
+ \OC\Files\Filesystem::mount($storage1, array(), '/');
+ $storage1->rename('folder', 'foo');
+ $scanner = $storage1->getScanner();
+ $scanner->scan('');
+
+ $view = new \OC\Files\View('/foo');
+
+ $result = $view->search('.txt');
+ $this->assertCount(1, $result);
+ }
+
/**
* @param bool $scan
+ * @param string $class
* @return \OC\Files\Storage\Storage
*/
private function getTestStorage($scan = true, $class = '\OC\Files\Storage\Temporary') {