From eb76504df6a78111ccedeb2ef0a4deec1b640cca Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 22 Apr 2015 16:24:25 +0200 Subject: add unit tests for null handling in view --- tests/lib/files/view.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index c8629abc409..f064eaaa7fd 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -1033,4 +1033,21 @@ class View extends \Test\TestCase { $view = new \OC\Files\View(''); $this->assertTrue($view->rename('/test/foo.txt', '/test/foo/bar.txt')); } + + public function testGetAbsolutePathOnNull() { + $view = new \OC\Files\View(); + $this->assertNull($view->getAbsolutePath(null)); + } + + public function testGetRelativePathOnNull() { + $view = new \OC\Files\View(); + $this->assertNull($view->getRelativePath(null)); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testNullAsRoot() { + new \OC\Files\View(null); + } } -- cgit v1.2.3