From 541c8c092db947814a25f452a78a38f2cd2ff791 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 26 Feb 2015 12:20:20 +0100 Subject: [PATCH] Add unit test --- tests/lib/files/node/node.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/lib/files/node/node.php b/tests/lib/files/node/node.php index 49a2006c76..01ed84c4a0 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(); + } }