Add unit test

This commit is contained in:
Robin Appelman 2015-02-26 12:20:20 +01:00
parent f5befbeac6
commit 541c8c092d
1 changed files with 15 additions and 0 deletions

View 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();
}
}