diff options
Diffstat (limited to 'tests/lib/connector/sabre/objecttree.php')
-rw-r--r-- | tests/lib/connector/sabre/objecttree.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/lib/connector/sabre/objecttree.php b/tests/lib/connector/sabre/objecttree.php index fb50c736edd..bc8ec98faee 100644 --- a/tests/lib/connector/sabre/objecttree.php +++ b/tests/lib/connector/sabre/objecttree.php @@ -9,6 +9,7 @@ namespace Test\OC\Connector\Sabre; +use OC\Files\FileInfo; use OC_Connector_Sabre_Directory; use PHPUnit_Framework_TestCase; use Sabre_DAV_Exception_Forbidden; @@ -32,6 +33,10 @@ class TestDoubleFileView extends \OC\Files\View{ public function rename($path1, $path2) { return $this->canRename; } + + public function getRelativePath($path){ + return $path; + } } class ObjectTree extends PHPUnit_Framework_TestCase { @@ -91,10 +96,14 @@ class ObjectTree extends PHPUnit_Framework_TestCase { * @param $updatables */ private function moveTest($source, $dest, $updatables, $deletables) { - $rootDir = new OC_Connector_Sabre_Directory(''); + $view = new TestDoubleFileView($updatables, $deletables); + + $info = new FileInfo('', null, null, array()); + + $rootDir = new OC_Connector_Sabre_Directory($view, $info); $objectTree = $this->getMock('\OC\Connector\Sabre\ObjectTree', array('nodeExists', 'getNodeForPath'), - array($rootDir)); + array($rootDir, $view)); $objectTree->expects($this->once()) ->method('getNodeForPath') @@ -102,7 +111,7 @@ class ObjectTree extends PHPUnit_Framework_TestCase { ->will($this->returnValue(false)); /** @var $objectTree \OC\Connector\Sabre\ObjectTree */ - $objectTree->fileView = new TestDoubleFileView($updatables, $deletables); + $objectTree->init($rootDir, $view); $objectTree->move($source, $dest); } |