summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-24 19:27:33 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-24 19:27:33 +0200
commit66813e9df6eb96a960462a3dc8dbe1de4df5314c (patch)
tree69985a6adc77d66a5289e321172231f89849a4ec /tests
parent54e0f1d739b4b3820cafafca039a3524d3dd28ba (diff)
parent3917d18980638e86f5cce9242adeded0ca760260 (diff)
downloadnextcloud-server-66813e9df6eb96a960462a3dc8dbe1de4df5314c.tar.gz
nextcloud-server-66813e9df6eb96a960462a3dc8dbe1de4df5314c.zip
Merge branch 'master' into fix-language-detection
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/connector/sabre/directory.php34
-rw-r--r--tests/lib/connector/sabre/file.php7
2 files changed, 41 insertions, 0 deletions
diff --git a/tests/lib/connector/sabre/directory.php b/tests/lib/connector/sabre/directory.php
new file mode 100644
index 00000000000..c501521b601
--- /dev/null
+++ b/tests/lib/connector/sabre/directory.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Copyright (c) 2013 Thomas Müller <thomas.mueller@tmit.eu>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class Test_OC_Connector_Sabre_Directory extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @expectedException Sabre_DAV_Exception_Forbidden
+ */
+ public function testCreateSharedFileFails() {
+ $dir = new OC_Connector_Sabre_Directory('');
+ $dir->createFile('Shared');
+ }
+
+ /**
+ * @expectedException Sabre_DAV_Exception_Forbidden
+ */
+ public function testCreateSharedFolderFails() {
+ $dir = new OC_Connector_Sabre_Directory('');
+ $dir->createDirectory('Shared');
+ }
+
+ /**
+ * @expectedException Sabre_DAV_Exception_Forbidden
+ */
+ public function testDeleteSharedFolderFails() {
+ $dir = new OC_Connector_Sabre_Directory('Shared');
+ $dir->delete();
+ }
+}
diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php
index a1dade3d63d..e1fed0384c6 100644
--- a/tests/lib/connector/sabre/file.php
+++ b/tests/lib/connector/sabre/file.php
@@ -35,4 +35,11 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
$etag = $file->put('test data');
}
+ /**
+ * @expectedException Sabre_DAV_Exception_Forbidden
+ */
+ public function testDeleteSharedFails() {
+ $file = new OC_Connector_Sabre_File('Shared');
+ $file->delete();
+ }
}