From 8185eaa6dd1ca6c86bff73002e5a1a71bbd17529 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 12 Oct 2015 13:59:16 +0200 Subject: also detect files in a .part folder as part file --- tests/lib/files/cache/scanner.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/lib/files') 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], + ]; + } + } -- cgit v1.2.3