]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add unit test
authorRobin Appelman <icewind@owncloud.com>
Thu, 26 Feb 2015 11:20:20 +0000 (12:20 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 26 Feb 2015 11:20:20 +0000 (12:20 +0100)
tests/lib/files/node/node.php

index 49a2006c767aa2d5272a003b61169887c8f9a685..01ed84c4a065bc1b6f195f63dfb0b0f51bdf5c5a 100644 (file)
@@ -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();
+       }
 }