/**
* @param string $path
- * @throws \OCP\Files\NotFoundException
* @return string
*/
public function getRelativePath($path) {
if ($path === $this->path) {
return '/';
} else if (strpos($path, $this->path . '/') !== 0) {
- throw new NotFoundException();
+ return null;
} else {
$path = substr($path, strlen($this->path));
return $this->normalizePath($path);
$this->assertEquals('/bar/foo/qwerty', $result[0]->getPath());
}
- /**
- * @expectedException \OCP\Files\NotFoundException
- */
public function testGetByIdOutsideFolder() {
$manager = $this->getMock('\OC\Files\Mount\Manager');
/**
->will($this->returnValue($mount));
$node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
- $node->getById(1);
+ $result = $node->getById(1);
+ $this->assertCount(0, $result);
}
public function testGetByIdMultipleStorages() {