]> source.dussan.org Git - nextcloud-server.git/commitdiff
return the correct result when doing an smb rename
authorRobin Appelman <icewind@owncloud.com>
Tue, 1 Oct 2013 20:29:33 +0000 (22:29 +0200)
committerRobin Appelman <icewind@owncloud.com>
Tue, 1 Oct 2013 20:29:33 +0000 (22:29 +0200)
apps/files_external/3rdparty/smb4php/smb.php
apps/files_external/tests/smb.php

index aec181a35097b1936f4077a56c6c833f963cc62f..e91b0a59581b21aadcf2e838cb577cb5888f447f 100644 (file)
@@ -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) {
index ca2a93c894449f5584be40d6b996cc339b3aec89..86dbd3ab88d73d4d7c46943e9a14c6e30d52dd0b 100644 (file)
@@ -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);
+       }
 }