summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-27 10:34:25 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-27 10:34:25 +0200
commitfcc92a9f43e75ecdb15adb0e948d45eac119306f (patch)
treec75a3df23cdeeb6a2f5340ebbb1c56b8520b3fda /tests/lib
parentcbc71784c0a5b698f56d2005b4ac7b773d2e003a (diff)
downloadnextcloud-server-fcc92a9f43e75ecdb15adb0e948d45eac119306f.tar.gz
nextcloud-server-fcc92a9f43e75ecdb15adb0e948d45eac119306f.zip
add searchByMime to new cache api
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/files/cache/cache.php3
-rw-r--r--tests/lib/files/view.php3
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index 839e06e93fc..5a8d79b902c 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -129,6 +129,9 @@ class Cache extends \UnitTestCase {
$this->assertEquals(1, count($this->cache->search('%folder%')));
$this->assertEquals(1, count($this->cache->search('folder%')));
$this->assertEquals(3, count($this->cache->search('%')));
+
+ $this->assertEquals(3, count($this->cache->searchByMime('foo')));
+ $this->assertEquals(2, count($this->cache->searchByMime('foo/file')));
}
public function tearDown() {
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 980c5298fb4..5144fb1caad 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -139,6 +139,9 @@ class View extends \PHPUnit_Framework_TestCase {
}
$this->assertContains('/anotherstorage/foo.txt', $paths);
$this->assertContains('/anotherstorage/foo.png', $paths);
+
+ $this->assertEquals(6, count($rootView->searchByMime('text')));
+ $this->assertEquals(3, count($folderView->searchByMime('text')));
}
/**