return the correct result when doing an smb rename
This commit is contained in:
parent
ea6115bfaa
commit
ea566868a8
|
@ -307,7 +307,8 @@ class smb {
|
|||
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) {
|
||||
|
|
|
@ -15,7 +15,7 @@ class SMB extends Storage {
|
|||
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
|
||||
|
@ -28,4 +28,10 @@ class SMB extends Storage {
|
|||
\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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue