summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-09-16 13:40:12 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-17 11:16:00 +0200
commit2839ef34395599adf060a485a263a69ce27305e1 (patch)
treebe9037e061eecb9836e7fe7c4ad614e40ce63744 /tests
parent773941dfb021f7a29adb6076071155b3294a3465 (diff)
downloadnextcloud-server-2839ef34395599adf060a485a263a69ce27305e1.tar.gz
nextcloud-server-2839ef34395599adf060a485a263a69ce27305e1.zip
add unit test
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/connector/sabre/file.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php
index e5605dd7cc5..fe4c5ec7c29 100644
--- a/tests/lib/connector/sabre/file.php
+++ b/tests/lib/connector/sabre/file.php
@@ -809,4 +809,21 @@ class File extends \Test\TestCase {
return $files;
}
+ /**
+ * @expectedException \Sabre\DAV\Exception\ServiceUnavailable
+ */
+ public function testGetFopenFails() {
+ $view = $this->getMock('\OC\Files\View', ['fopen'], array());
+ $view->expects($this->atLeastOnce())
+ ->method('fopen')
+ ->will($this->returnValue(false));
+
+ $info = new \OC\Files\FileInfo('/test.txt', null, null, array(
+ 'permissions' => \OCP\Constants::PERMISSION_ALL
+ ), null);
+
+ $file = new \OC\Connector\Sabre\File($view, $info);
+
+ $file->get();
+ }
}