summaryrefslogtreecommitdiffstats
path: root/tests/lib/connector/sabre/file.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/connector/sabre/file.php')
-rw-r--r--tests/lib/connector/sabre/file.php25
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
*/