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:
authorBjoern Schiessle <schiessle@owncloud.com>2015-10-12 14:59:16 +0300
committerBjoern Schiessle <schiessle@owncloud.com>2015-10-12 14:59:16 +0300
commit8185eaa6dd1ca6c86bff73002e5a1a71bbd17529 (patch)
tree2558059280cafb8f7f2d6f9bfe24883eadf32649 /tests
parent0036c637fcafe121cd964f29ad998c9b1bfc31ec (diff)
also detect files in a .part folder as part file
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/scanner.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php
index b44cf0a49df..871b12bac3a 100644
--- a/tests/lib/files/cache/scanner.php
+++ b/tests/lib/files/cache/scanner.php
@@ -284,4 +284,27 @@ class Scanner extends \Test\TestCase {
$cachedData = $this->cache->get('folder/bar.txt');
$this->assertEquals($newFolderId, $cachedData['parent']);
}
+
+ /**
+ * @dataProvider dataTestIsPartialFile
+ *
+ * @param string $path
+ * @param bool $expected
+ */
+ public function testIsPartialFile($path, $expected) {
+ $this->assertSame($expected,
+ $this->scanner->isPartialFile($path)
+ );
+ }
+
+ public function dataTestIsPartialFile() {
+ return [
+ ['foo.txt.part', true],
+ ['/sub/folder/foo.txt.part', true],
+ ['/sub/folder.part/foo.txt', true],
+ ['foo.txt', false],
+ ['/sub/folder/foo.txt', false],
+ ];
+ }
+
}