mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Fix: delete of files with [ and glob.
Conflicts: test/phpunit/FilesLibTest.php
This commit is contained in:
@@ -326,7 +326,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
||||
// Again to test with overwriting=1
|
||||
$result=dol_copy($file, $conf->admin->dir_temp.'/file.csv',0,1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertGreaterThanOrEqual(1,$result); // Should be 1
|
||||
$this->assertGreaterThanOrEqual(1,$result,'copy destination already exists, overwrite'); // Should be 1
|
||||
|
||||
// Again to test with overwriting=1
|
||||
$result=dol_move($conf->admin->dir_temp.'/file.csv',$conf->admin->dir_temp.'/file2.csv',0,1);
|
||||
@@ -340,7 +340,17 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
||||
// Again to test no erreor when deleteing a non existing file
|
||||
$result=dol_delete_file($conf->admin->dir_temp.'/file2.csv');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result);
|
||||
$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);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertGreaterThanOrEqual(1,$result,'copy file with special char, overwrite'); // Should be 1
|
||||
|
||||
// Try to delete using a glob criteria
|
||||
$result=dol_delete_file($conf->admin->dir_temp.'/file with [x]*é.csv');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result,'delete file using glob criteria');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -377,4 +387,4 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(0,count($result));
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user