From 097c5ffaf5a9333ff4dddf251bfe8fe402cc993a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Sep 2020 14:41:04 +0200 Subject: [PATCH] Test --- test/phpunit/FilesLibTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index e8bbc664619..669f739646e 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -1,4 +1,6 @@ * Copyright (C) 2012 Regis Houssin * @@ -359,14 +361,17 @@ class FilesLibTest extends PHPUnit\Framework\TestCase $this->assertTrue($result, 'move with default mask'); // To test a move that should work with forced mask - $result=dol_move($conf->admin->dir_temp.'/file2.csv', $conf->admin->dir_temp.'/file3.csv', '0754', 1); // file shoutld be rwxr-wr-- + $result=dol_move($conf->admin->dir_temp.'/file2.csv', $conf->admin->dir_temp.'/file3.csv', '0754', 1); // file should be rwxr-wr-- print __METHOD__." result=".$result."\n"; $this->assertTrue($result, 'move with forced mask'); + $conf->global->MAIN_ENABLE_LOG_TO_HTML=1; $conf->syslog->enabled=1; $_REQUEST['logtohtml']=1; + $conf->logbuffer=array(); + // To test a delete that should success $result=dol_delete_file($conf->admin->dir_temp.'/file3.csv'); - print __METHOD__." result=".$result."\n"; - $this->assertTrue($result, 'delete file'); + print __METHOD__." result delete=".var_export($result, true)."\n"; + $this->assertTrue($result, 'delete file '.join("\n", $conf->logbuffer)); // Again to test there is error when deleting a non existing file with option disableglob $result=dol_delete_file($conf->admin->dir_temp.'/file3.csv', 1, 1);