aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests')
-rw-r--r--apps/files_external/tests/config.php25
-rw-r--r--apps/files_external/tests/ftp.php30
-rw-r--r--apps/files_external/tests/google.php45
-rw-r--r--apps/files_external/tests/webdav.php30
4 files changed, 130 insertions, 0 deletions
diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php
new file mode 100644
index 00000000000..fa4c74a6e26
--- /dev/null
+++ b/apps/files_external/tests/config.php
@@ -0,0 +1,25 @@
+<?php
+return array(
+ 'ftp'=>array(
+ 'run'=>false,
+ 'host'=>'localhost',
+ 'user'=>'test',
+ 'password'=>'test',
+ 'root'=>'/test',
+ ),
+ 'webdav'=>array(
+ 'run'=>false,
+ 'host'=>'localhost',
+ 'user'=>'test',
+ 'password'=>'test',
+ 'root'=>'/owncloud/files/webdav.php',
+ ),
+ 'google'=>array(
+ 'run'=>false,
+ 'consumer_key'=>'anonymous',
+ 'consumer_secret'=>'anonymous',
+ 'token'=>'test',
+ 'token_secret'=>'test',
+ 'root'=>'/google',
+ )
+);
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php
new file mode 100644
index 00000000000..e30fb9a1c38
--- /dev/null
+++ b/apps/files_external/tests/ftp.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+$config=include('apps/files_external/tests/config.php');
+if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']){
+ abstract class Test_Filestorage_FTP extends Test_FileStorage{}
+ return;
+}else{
+ class Test_Filestorage_FTP extends Test_FileStorage {
+ private $config;
+ private $id;
+
+ public function setUp(){
+ $id=uniqid();
+ $this->config=include('apps/files_external/tests/config.php');
+ $this->config['ftp']['root'].='/'.$id;//make sure we have an new empty folder to work in
+ $this->instance=new OC_Filestorage_FTP($this->config['ftp']);
+ }
+
+ public function tearDown(){
+ OC_Helper::rmdirr($this->instance->constructUrl(''));
+ }
+ }
+}
+
diff --git a/apps/files_external/tests/google.php b/apps/files_external/tests/google.php
new file mode 100644
index 00000000000..08116f0e748
--- /dev/null
+++ b/apps/files_external/tests/google.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+* ownCloud
+*
+* @author Michael Gapczynski
+* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+$config=include('apps/files_external/tests/config.php');
+if(!is_array($config) or !isset($config['google']) or !$config['google']['run']){
+ abstract class Test_Filestorage_Google extends Test_FileStorage{}
+ return;
+}else{
+ class Test_Filestorage_Google extends Test_FileStorage {
+
+ private $config;
+ private $id;
+
+ public function setUp(){
+ $id=uniqid();
+ $this->config=include('apps/files_external/tests/config.php');
+ $this->config['google']['root'].='/'.$id;//make sure we have an new empty folder to work in
+ $this->instance=new OC_Filestorage_Google($this->config['google']);
+ }
+
+ public function tearDown(){
+ $this->instance->rmdir('/');
+ }
+ }
+}
+
diff --git a/apps/files_external/tests/webdav.php b/apps/files_external/tests/webdav.php
new file mode 100644
index 00000000000..144659819b6
--- /dev/null
+++ b/apps/files_external/tests/webdav.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+$config=include('apps/files_external/tests/config.php');
+if(!is_array($config) or !isset($config['webdav']) or !$config['webdav']['run']){
+ abstract class Test_Filestorage_DAV extends Test_FileStorage{}
+ return;
+}else{
+ class Test_Filestorage_DAV extends Test_FileStorage {
+ private $config;
+ private $id;
+
+ public function setUp(){
+ $id=uniqid();
+ $this->config=include('apps/files_external/tests/config.php');
+ $this->config['webdav']['root'].='/'.$id;//make sure we have an new empty folder to work in
+ $this->instance=new OC_Filestorage_DAV($this->config['webdav']);
+ }
+
+ public function tearDown(){
+ $this->instance->rmdir('/');
+ }
+ }
+}
+