diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-01-13 13:59:28 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-01-13 13:59:28 +0100 |
commit | 96dff341e271f2c662f35fe0888e7e0992a8d33b (patch) | |
tree | 47242d6dc0df6266fd2eb9c273a018ce7ce02d70 /tests/lib/files/view.php | |
parent | 6d73aff9ad44f81b65b6ddc74f06a59e562f971b (diff) | |
download | nextcloud-server-96dff341e271f2c662f35fe0888e7e0992a8d33b.tar.gz nextcloud-server-96dff341e271f2c662f35fe0888e7e0992a8d33b.zip |
Return valid fileinfo objects for part files
Diffstat (limited to 'tests/lib/files/view.php')
-rw-r--r-- | tests/lib/files/view.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 25065967260..3ff19d7385d 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -703,6 +703,20 @@ class View extends \Test\TestCase { $this->assertEquals($expectedPath, $view->getAbsolutePath($relativePath)); } + public function testPartFileInfo() { + $storage = new Temporary(array()); + $scanner = $storage->getScanner(); + \OC\Files\Filesystem::mount($storage, array(), '/test/'); + $storage->file_put_contents('test.part', 'foobar'); + $scanner->scan(''); + $view = new \OC\Files\View('/test'); + $info = $view->getFileInfo('test.part'); + + $this->assertInstanceOf('\OCP\Files\FileInfo', $info); + $this->assertNull($info->getId()); + $this->assertEquals(6, $info->getSize()); + } + function absolutePathProvider() { return array( array('/files/', ''), |