diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-06-27 12:28:50 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-06-27 12:28:50 +0300 |
commit | 8a1cfa4229d0d77fa863dca64d4a434c7c03f806 (patch) | |
tree | d3fcf650e9540d76cd1e75c0d9b5dbb49e52bea8 /tests | |
parent | 747cc45e9c45adc93ccabb0315b016ed32dccd83 (diff) | |
parent | eb76504df6a78111ccedeb2ef0a4deec1b640cca (diff) |
Merge pull request #17171 from owncloud/view-null-root-stable8
[stable8] dont allow using null as view root
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/view.php | 17 |
1 files changed, 17 insertions, 0 deletions
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); + } } |