only run archive tests if the test data is available

This commit is contained in:
Robin Appelman 2012-04-15 13:34:54 +02:00
parent 71cdfdcec8
commit 9ee931e790
2 changed files with 22 additions and 14 deletions

View File

@ -8,7 +8,8 @@
require_once('archive.php'); require_once('archive.php');
class Test_Archive_TAR extends Test_Archive{ if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
class Test_Archive_TAR extends Test_Archive{
protected function getExisting(){ protected function getExisting(){
$dir=OC::$SERVERROOT.'/apps/files_archive/tests/data'; $dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
return new OC_Archive_TAR($dir.'/data.tar.gz'); return new OC_Archive_TAR($dir.'/data.tar.gz');
@ -17,4 +18,7 @@ class Test_Archive_TAR extends Test_Archive{
protected function getNew(){ protected function getNew(){
return new OC_Archive_TAR(OC_Helper::tmpFile('.tar.gz')); return new OC_Archive_TAR(OC_Helper::tmpFile('.tar.gz'));
} }
}
}else{
abstract class Test_Archive_TAR extends Test_Archive{}
} }

View File

@ -8,7 +8,8 @@
require_once('archive.php'); require_once('archive.php');
class Test_Archive_ZIP extends Test_Archive{ if(is_dir(OC::$SERVERROOT.'/apps/files_archive/tests/data')){
class Test_Archive_ZIP extends Test_Archive{
protected function getExisting(){ protected function getExisting(){
$dir=OC::$SERVERROOT.'/apps/files_archive/tests/data'; $dir=OC::$SERVERROOT.'/apps/files_archive/tests/data';
return new OC_Archive_ZIP($dir.'/data.zip'); return new OC_Archive_ZIP($dir.'/data.zip');
@ -17,4 +18,7 @@ class Test_Archive_ZIP extends Test_Archive{
protected function getNew(){ protected function getNew(){
return new OC_Archive_ZIP(OC_Helper::tmpFile('.zip')); return new OC_Archive_ZIP(OC_Helper::tmpFile('.zip'));
} }
}
}else{
abstract class Test_Archive_ZIP extends Test_Archive{}
} }