summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-06-05 13:55:12 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-06-05 13:55:12 +0200
commit249e54e34a578b3b4b679eddb3dde3e13b173734 (patch)
tree0667c97cf6481a831b5354188e4ad558c561da6e
parent06dda427f38f240539f4d3054da7a5eb80aaaf8b (diff)
downloadnextcloud-server-249e54e34a578b3b4b679eddb3dde3e13b173734.tar.gz
nextcloud-server-249e54e34a578b3b4b679eddb3dde3e13b173734.zip
Add unit tests for InvalidPath Exception being thrown
-rw-r--r--tests/lib/connector/sabre/directory.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/lib/connector/sabre/directory.php b/tests/lib/connector/sabre/directory.php
index 2550f2bcef1..a048c7ab30a 100644
--- a/tests/lib/connector/sabre/directory.php
+++ b/tests/lib/connector/sabre/directory.php
@@ -140,7 +140,33 @@ class Test_OC_Connector_Sabre_Directory extends \Test\TestCase {
// calling a second time just returns the cached values,
// does not call getDirectoryContents again
- $nodes = $dir->getChildren();
+ $dir->getChildren();
+ }
+
+ /**
+ * @expectedException \Sabre\DAV\Exception\ServiceUnavailable
+ */
+ public function testGetChildThrowStorageNotAvailableException() {
+ $this->view->expects($this->once())
+ ->method('getFileInfo')
+ ->willThrowException(new \OCP\Files\StorageNotAvailableException());
+
+ $dir = new \OC\Connector\Sabre\Directory($this->view, $this->info);
+ $dir->getChild('.');
+ }
+
+ /**
+ * @expectedException \OC\Connector\Sabre\Exception\InvalidPath
+ */
+ public function testGetChildThrowInvalidPath() {
+ $this->view->expects($this->once())
+ ->method('verifyPath')
+ ->willThrowException(new \OCP\Files\InvalidPathException());
+ $this->view->expects($this->never())
+ ->method('getFileInfo');
+
+ $dir = new \OC\Connector\Sabre\Directory($this->view, $this->info);
+ $dir->getChild('.');
}
public function testGetQuotaInfo() {