summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-26 12:20:20 +0100
committerRobin Appelman <icewind@owncloud.com>2015-02-26 12:20:20 +0100
commit541c8c092db947814a25f452a78a38f2cd2ff791 (patch)
tree70e85c038147cd03b3f87d0dfcb137872a6d2fd4
parentf5befbeac64ee21ff12ba12ee8e25c743979714b (diff)
downloadnextcloud-server-541c8c092db947814a25f452a78a38f2cd2ff791.tar.gz
nextcloud-server-541c8c092db947814a25f452a78a38f2cd2ff791.zip
Add unit test
-rw-r--r--tests/lib/files/node/node.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/files/node/node.php b/tests/lib/files/node/node.php
index 49a2006c767..01ed84c4a06 100644
--- a/tests/lib/files/node/node.php
+++ b/tests/lib/files/node/node.php
@@ -340,4 +340,19 @@ class Node extends \Test\TestCase {
$node = new \OC\Files\Node\Node($root, $view, '/bar/foo');
$node->touch(100);
}
+
+ /**
+ * @expectedException \OCP\Files\InvalidPathException
+ */
+ public function testInvalidPath() {
+ $manager = $this->getMock('\OC\Files\Mount\Manager');
+ /**
+ * @var \OC\Files\View | \PHPUnit_Framework_MockObject_MockObject $view
+ */
+ $view = $this->getMock('\OC\Files\View');
+ $root = $this->getMock('\OC\Files\Node\Root', array(), array($manager, $view, $this->user));
+
+ $node = new \OC\Files\Node\Node($root, $view, '/../foo');
+ $node->getFileInfo();
+ }
}