From 54695b11eb3e8c3b0d0a03df1b8c9434c5ce4746 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Sat, 6 Oct 2012 13:43:34 +0200
Subject: [PATCH] test case for dropbox storage

---
 apps/files_external/tests/config.php  |  9 +++++++++
 apps/files_external/tests/dropbox.php | 28 +++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 apps/files_external/tests/dropbox.php

diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php
index e58a87fabd..7779f61894 100644
--- a/apps/files_external/tests/config.php
+++ b/apps/files_external/tests/config.php
@@ -43,4 +43,13 @@ return array(
 		'secret'=>'test',
 		'bucket'=>'bucket',
 	),
+	'dropbox' => array (
+		'run'=>false,
+		'root'=>'owncloud',
+		'configured' => 'true',
+		'app_key' => '',
+		'app_secret' => '',
+		'token' => '',
+		'token_secret' => ''
+	)
 );
diff --git a/apps/files_external/tests/dropbox.php b/apps/files_external/tests/dropbox.php
new file mode 100644
index 0000000000..64eb2556c9
--- /dev/null
+++ b/apps/files_external/tests/dropbox.php
@@ -0,0 +1,28 @@
+<?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('files_external/tests/config.php');
+if(!is_array($config) or !isset($config['dropbox']) or !$config['dropbox']['run']) {
+	abstract class Test_Filestorage_Dropbox extends Test_FileStorage{}
+	return;
+}else{
+	class Test_Filestorage_Dropbox extends Test_FileStorage {
+		private $config;
+
+		public function setUp() {
+			$id=uniqid();
+			$this->config=include('files_external/tests/config.php');
+			$this->config['dropbox']['root'].='/'.$id;//make sure we have an new empty folder to work in
+			$this->instance=new OC_Filestorage_Dropbox($this->config['dropbox']);
+		}
+
+		public function tearDown() {
+			$this->instance->unlink('/');
+		}
+	}
+}
-- 
GitLab