]> source.dussan.org Git - nextcloud-server.git/commitdiff
test cases added for create/remove Shared folder and file
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 22 Oct 2013 09:22:06 +0000 (11:22 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 22 Oct 2013 09:22:06 +0000 (11:22 +0200)
tests/lib/connector/sabre/directory.php [new file with mode: 0644]
tests/lib/connector/sabre/file.php

diff --git a/tests/lib/connector/sabre/directory.php b/tests/lib/connector/sabre/directory.php
new file mode 100644 (file)
index 0000000..c501521
--- /dev/null
@@ -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();
+       }
+}
index a1dade3d63de37a58c2f2b121acb6ecf261e097d..e1fed0384c6f7b0678f8c5d1c205adc48d99e79c 100644 (file)
@@ -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();
+       }
 }