Skip to content
Snippets Groups Projects
Commit eb62c7e4 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #1446 from GPCsolutions/removefiles

Made test pessimistic by default
parents 15405c9f 7d08c95f
No related branches found
No related tags found
No related merge requests found
......@@ -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 $db, $conf, $user, $langs;
global $langs;
global $hookmanager;
$langs->load("other");
......@@ -829,10 +829,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
}
else
{
$error=0;
//print "x".$file." ".$disableglob;exit;
$ok=true;
$ok=false;
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
if (empty($disableglob) && ! empty($file_osencoded))
{
......
......@@ -339,10 +339,9 @@ 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->assertTrue($result,'delete file that does not exists');
$this->assertFalse($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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment