2013-10-22 13:22:06 +04:00
|
|
|
<?php
|
2014-03-03 17:27:24 +04:00
|
|
|
|
2013-10-22 13:22:06 +04:00
|
|
|
/**
|
|
|
|
* 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 {
|
|
|
|
|
2014-03-03 17:27:24 +04:00
|
|
|
private function getRootDir() {
|
|
|
|
$view = $this->getMock('OC\Files\View', array(), array(), '', false);
|
|
|
|
$view->expects($this->once())
|
|
|
|
->method('getRelativePath')
|
|
|
|
->will($this->returnValue(''));
|
|
|
|
|
|
|
|
$info = $this->getMock('OC\Files\FileInfo', array(), array(), '', false);
|
|
|
|
$info->expects($this->once())
|
|
|
|
->method('getPath')
|
|
|
|
->will($this->returnValue(''));
|
|
|
|
|
|
|
|
return new OC_Connector_Sabre_Directory($view, $info);
|
|
|
|
}
|
|
|
|
|
2013-10-22 13:22:06 +04:00
|
|
|
/**
|
|
|
|
* @expectedException Sabre_DAV_Exception_Forbidden
|
|
|
|
*/
|
|
|
|
public function testCreateSharedFileFails() {
|
2014-03-03 17:27:24 +04:00
|
|
|
$dir = $this->getRootDir();
|
2013-10-22 13:22:06 +04:00
|
|
|
$dir->createFile('Shared');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @expectedException Sabre_DAV_Exception_Forbidden
|
|
|
|
*/
|
|
|
|
public function testCreateSharedFolderFails() {
|
2014-03-03 17:27:24 +04:00
|
|
|
$dir = $this->getRootDir();
|
2013-10-22 13:22:06 +04:00
|
|
|
$dir->createDirectory('Shared');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @expectedException Sabre_DAV_Exception_Forbidden
|
|
|
|
*/
|
|
|
|
public function testDeleteSharedFolderFails() {
|
2014-03-03 17:27:24 +04:00
|
|
|
$dir = $this->getRootDir();
|
2013-10-22 13:22:06 +04:00
|
|
|
$dir->delete();
|
|
|
|
}
|
|
|
|
}
|