add unit tests for null handling in view

This commit is contained in:
Robin Appelman 2015-04-22 16:24:25 +02:00
parent f391f88d7f
commit e302213248
1 changed files with 19 additions and 2 deletions

View File

@ -1063,4 +1063,21 @@ class View extends \Test\TestCase {
$watcher = $storage->getWatcher(); $watcher = $storage->getWatcher();
$this->assertEquals(Watcher::CHECK_NEVER, $watcher->getPolicy()); $this->assertEquals(Watcher::CHECK_NEVER, $watcher->getPolicy());
} }
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);
}
} }