diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-01-26 17:48:28 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-01-29 12:47:12 +0100 |
commit | 05035ef4af2222f67bb10e26f096e7eab04dfc17 (patch) | |
tree | 193a560b4781b2af0e3dd12dc18a597ce52485a6 /tests | |
parent | ddee63fa00e13e1830aa4b6113d30f24b3b34535 (diff) | |
download | nextcloud-server-05035ef4af2222f67bb10e26f096e7eab04dfc17.tar.gz nextcloud-server-05035ef4af2222f67bb10e26f096e7eab04dfc17.zip |
Fix webdav put for single file webdav shares
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/connector/sabre/file.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php index 6bb1b4e75d1..33dc78f87d8 100644 --- a/tests/lib/connector/sabre/file.php +++ b/tests/lib/connector/sabre/file.php @@ -32,6 +32,31 @@ class Test_OC_Connector_Sabre_File extends \Test\TestCase { $file->put('test data'); } + public function testPutSingleFileShare() { + // setup + $storage = $this->getMock('\OCP\Files\Storage'); + $view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'), array()); + $view->expects($this->any()) + ->method('resolvePath') + ->with('') + ->will($this->returnValue(array($storage, ''))); + $view->expects($this->any()) + ->method('getRelativePath') + ->will($this->returnValue('')); + $view->expects($this->any()) + ->method('file_put_contents') + ->with('') + ->will($this->returnValue(true)); + + $info = new \OC\Files\FileInfo('/foo.txt', null, null, array( + 'permissions' => \OCP\Constants::PERMISSION_ALL + ), null); + + $file = new OC_Connector_Sabre_File($view, $info); + + $this->assertNotEmpty($file->put('test data')); + } + /** * @expectedException \Sabre\DAV\Exception */ |