diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-02-16 17:37:20 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-02-16 17:37:20 +0100 |
commit | fadf0a944345272cb2303283dafd4fa70ff688b0 (patch) | |
tree | 50df4907dfe27d1f2f49d48265f25cc179d98a4e /apps/files_external/tests | |
parent | 92710591955e4696c29628b438dbb7a173ee379c (diff) | |
parent | 6477e39be931e33864c64bfcea72391e51f44213 (diff) | |
download | nextcloud-server-fadf0a944345272cb2303283dafd4fa70ff688b0.tar.gz nextcloud-server-fadf0a944345272cb2303283dafd4fa70ff688b0.zip |
Merge pull request #10673 from owncloud/smb-new
New SMB storage backend
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r-- | apps/files_external/tests/backends/smb.php | 7 | ||||
-rw-r--r-- | apps/files_external/tests/backends/webdav.php | 2 | ||||
-rw-r--r-- | apps/files_external/tests/smbfunctions.php | 39 |
3 files changed, 4 insertions, 44 deletions
diff --git a/apps/files_external/tests/backends/smb.php b/apps/files_external/tests/backends/smb.php index 4b2f4425ebc..4b1150c6a25 100644 --- a/apps/files_external/tests/backends/smb.php +++ b/apps/files_external/tests/backends/smb.php @@ -10,8 +10,6 @@ namespace Test\Files\Storage; class SMB extends Storage { - private $config; - protected function setUp() { parent::setUp(); @@ -20,6 +18,9 @@ class SMB extends Storage { if (!is_array($config) or !$config['run']) { $this->markTestSkipped('Samba backend not configured'); } + if (substr($config['root'], -1, 1) != '/') { + $config['root'] .= '/'; + } $config['root'] .= $id; //make sure we have an new empty folder to work in $this->instance = new \OC\Files\Storage\SMB($config); $this->instance->mkdir('/'); @@ -27,7 +28,7 @@ class SMB extends Storage { protected function tearDown() { if ($this->instance) { - \OCP\Files::rmdirr($this->instance->constructUrl('')); + $this->instance->rmdir(''); } parent::tearDown(); diff --git a/apps/files_external/tests/backends/webdav.php b/apps/files_external/tests/backends/webdav.php index c390612810d..c454c8e4a9d 100644 --- a/apps/files_external/tests/backends/webdav.php +++ b/apps/files_external/tests/backends/webdav.php @@ -10,8 +10,6 @@ namespace Test\Files\Storage; class DAV extends Storage { - private $config; - protected function setUp() { parent::setUp(); diff --git a/apps/files_external/tests/smbfunctions.php b/apps/files_external/tests/smbfunctions.php deleted file mode 100644 index cf9f7cb20fe..00000000000 --- a/apps/files_external/tests/smbfunctions.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * Copyright (c) 2013 Vincent Petry <pvince81@owncloud.com> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace Test\Files\Storage; - -class SMBFunctions extends \Test\TestCase { - - protected function setUp() { - parent::setUp(); - - // dummy config - $this->config = array( - 'run'=>false, - 'user'=>'test', - 'password'=>'testpassword', - 'host'=>'smbhost', - 'share'=>'/sharename', - 'root'=>'/rootdir/', - ); - - $this->instance = new \OC\Files\Storage\SMB($this->config); - } - - public function testGetId() { - $this->assertEquals('smb::test@smbhost//sharename//rootdir/', $this->instance->getId()); - } - - public function testConstructUrl() { - $this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc", $this->instance->constructUrl('/abc')); - $this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc", $this->instance->constructUrl('/abc/')); - $this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc%2F", $this->instance->constructUrl('/abc/.')); - $this->assertEquals("smb://test:testpassword@smbhost/sharename/rootdir/abc%2Fdef", $this->instance->constructUrl('/abc/def')); - } -} |