Merge pull request #2928 from Dolibarr/revert-1446-removefiles

Revert "Made test pessimistic by default"
This commit is contained in:
Laurent Destailleur 2015-05-29 17:10:02 +02:00
commit 92440d125b
2 changed files with 6 additions and 3 deletions

View File

@ -802,7 +802,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
*/
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null)
{
global $langs;
global $db, $conf, $user, $langs;
global $hookmanager;
$langs->load("other");
@ -829,8 +829,10 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
}
else
{
$error=0;
//print "x".$file." ".$disableglob;exit;
$ok=false;
$ok=true;
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
if (empty($disableglob) && ! empty($file_osencoded))
{

View File

@ -339,9 +339,10 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
print __METHOD__." result=".$result."\n";
$this->assertTrue($result,'delete file');
// Again to test no error when deleteing a non existing file
$result=dol_delete_file($conf->admin->dir_temp.'/file2.csv');
print __METHOD__." result=".$result."\n";
$this->assertFalse($result,'delete file that does not exists');
$this->assertTrue($result,'delete file that does not exists');
// Test copy with special char / delete with blob
$result=dol_copy($file, $conf->admin->dir_temp.'/file with [x] and é.csv',0,1);