trigger_error('rename(): error in URL', E_USER_ERROR);
}
smb::clearstatcache ($url_from);
- return smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to);
+ $result = smb::execute ('rename "'.$from['path'].'" "'.$to['path'].'"', $to);
+ return $result !== false;
}
function mkdir ($url, $mode, $options) {
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
- if ( ! is_array($this->config) or ! isset($this->config['smb']) or ! $this->config['smb']['run']) {
+ if (!is_array($this->config) or !isset($this->config['smb']) or !$this->config['smb']['run']) {
$this->markTestSkipped('Samba backend not configured');
}
$this->config['smb']['root'] .= $id; //make sure we have an new empty folder to work in
\OCP\Files::rmdirr($this->instance->constructUrl(''));
}
}
+
+ public function testRenameWithSpaces() {
+ $this->instance->mkdir('with spaces');
+ $result = $this->instance->rename('with spaces', 'foo bar');
+ $this->assertTrue($result);
+ }
}