diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-01-14 22:39:19 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-01-14 22:39:19 +0100 |
commit | 337c43ce9266106c803e6593e2006fd2b11b4f81 (patch) | |
tree | 3f30c3f015f7110d1700d8dd6550227e66f60f40 /tests | |
parent | 64d7463ca369ccf7b141e6699f8973781e531bd4 (diff) | |
parent | 96dff341e271f2c662f35fe0888e7e0992a8d33b (diff) | |
download | nextcloud-server-337c43ce9266106c803e6593e2006fd2b11b4f81.tar.gz nextcloud-server-337c43ce9266106c803e6593e2006fd2b11b4f81.zip |
Merge pull request #13317 from owncloud/partfile-fileinfo
Return valid fileinfo objects for part files
Diffstat (limited to 'tests')
-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/', ''), |