summaryrefslogtreecommitdiffstats
path: root/tests/lib/archive
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-05-02 23:48:23 +0200
committerRobin Appelman <icewind@owncloud.com>2012-05-02 23:48:23 +0200
commite5ef3e1340f68fdcc46ba318dab1773b8fb530a8 (patch)
treeab6c54857001552b62254f4950cc6caf45ce7720 /tests/lib/archive
parent0b51c5344399d9990d46b275afb82fbfbd070ad4 (diff)
downloadnextcloud-server-e5ef3e1340f68fdcc46ba318dab1773b8fb530a8.tar.gz
nextcloud-server-e5ef3e1340f68fdcc46ba318dab1773b8fb530a8.zip
move archive library to core so we can properly depend on it
Diffstat (limited to 'tests/lib/archive')
-rwxr-xr-xtests/lib/archive/tar.php24
-rwxr-xr-xtests/lib/archive/zip.php24
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/lib/archive/tar.php b/tests/lib/archive/tar.php
new file mode 100755
index 00000000000..c138a51a651
--- /dev/null
+++ b/tests/lib/archive/tar.php
@@ -0,0 +1,24 @@
+<?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.
+ */
+
+require_once('archive.php');
+
+if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
+ class Test_Archive_TAR extends Test_Archive{
+ protected function getExisting(){
+ $dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
+ return new OC_Archive_TAR($dir.'/data.tar.gz');
+ }
+
+ protected function getNew(){
+ return new OC_Archive_TAR(OCP\Files::tmpFile('.tar.gz'));
+ }
+ }
+}else{
+ abstract class Test_Archive_TAR extends Test_Archive{}
+}
diff --git a/tests/lib/archive/zip.php b/tests/lib/archive/zip.php
new file mode 100755
index 00000000000..615c9e3c7e2
--- /dev/null
+++ b/tests/lib/archive/zip.php
@@ -0,0 +1,24 @@
+<?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.
+ */
+
+require_once('archive.php');
+
+if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
+ class Test_Archive_ZIP extends Test_Archive{
+ protected function getExisting(){
+ $dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
+ return new OC_Archive_ZIP($dir.'/data.zip');
+ }
+
+ protected function getNew(){
+ return new OC_Archive_ZIP(OCP\Files::tmpFile('.zip'));
+ }
+ }
+}else{
+ abstract class Test_Archive_ZIP extends Test_Archive{}
+}