diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-23 10:50:36 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-23 10:50:36 -0700 |
commit | caa3a8d784b2444beace4e10e8544dcad8c5fafe (patch) | |
tree | eced2c95f89632a5bb39e7630f32ae7ff8d3f5f4 /tests | |
parent | 30cf7fee11a9ff3ea9618fa8f48502fcd5c12ee9 (diff) | |
parent | f62c4eafa549a26efcce025e3b33ed87cbce5fd4 (diff) | |
download | nextcloud-server-caa3a8d784b2444beace4e10e8544dcad8c5fafe.tar.gz nextcloud-server-caa3a8d784b2444beace4e10e8544dcad8c5fafe.zip |
Merge pull request #5464 from owncloud/fixing-5456-master
Fixing 5456 master
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/connector/sabre/directory.php | 34 | ||||
-rw-r--r-- | tests/lib/connector/sabre/file.php | 7 |
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(); + } } |