From: Robin Appelman Date: Mon, 13 Jun 2011 23:22:58 +0000 (+0200) Subject: small fix in filesystem test X-Git-Tag: v3.0~267^2~528 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=141ffbb1f53f465e64125a020dee6304075a51aa;p=nextcloud-server.git small fix in filesystem test --- diff --git a/tests/index.php b/tests/index.php index 5e0dbc2c838..30ebde11235 100644 --- a/tests/index.php +++ b/tests/index.php @@ -30,7 +30,7 @@ require_once('testcase.php'); require_once('template.php'); $testCases=loadFiles(__DIR__,array('index.php','templates')); - +ob_end_clean(); $testResults=array(); foreach($testCases as $testCaseClass){ $testCase=new $testCaseClass(); @@ -65,10 +65,10 @@ function loadFiles($path,$exclude=false){ $dh=opendir($path); while($file=readdir($dh)){ if($file!='.' && $file!='..' && array_search($file,$exclude)===false){ - if(is_file($path.'/'.$file)){ + if(is_file($path.'/'.$file) and substr($file,-3)=='php'){ $result=require_once($path.'/'.$file); $results[]=$result; - }else{ + }elseif(is_dir($path.'/'.$file)){ $subResults=loadFiles($path.'/'.$file); $results=array_merge($results,$subResults); } diff --git a/tests/lib/filesystem.php b/tests/lib/filesystem.php index 73b0069519f..1b1703a06d7 100644 --- a/tests/lib/filesystem.php +++ b/tests/lib/filesystem.php @@ -84,7 +84,6 @@ class OC_FILEYSYSTEM_Test extends OC_TestCase public function readfile(){ OC_FILESYSTEM::file_put_contents('/dummy','foo'); - ob_clean(); ob_start(); OC_FILESYSTEM::readfile('/dummy'); $this->assertEquals('foo', ob_get_contents(),'Unexpected output of readfile');