From 0ee6c60e94efcd3712403b8432da778b113532cd Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Wed, 12 Jan 2022 09:12:04 +0100 Subject: [PATCH] :white_check_mark: Fix DBBackupTest (again :/) Was working on Windows but not on Linux... --- setup/backup.class.inc.php | 2 +- test/setup/DBBackupTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/backup.class.inc.php b/setup/backup.class.inc.php index 64d4ff1c0..d6cc51e96 100644 --- a/setup/backup.class.inc.php +++ b/setup/backup.class.inc.php @@ -255,7 +255,7 @@ class DBBackup return $aRet; } - protected static function EscapeShellArg($sValue) + public static function EscapeShellArg($sValue) { // Note: See comment from the 23-Apr-2004 03:30 in the PHP documentation // It suggests to rely on pctnl_* function instead of using escapeshellargs diff --git a/test/setup/DBBackupTest.php b/test/setup/DBBackupTest.php index 176f02e5d..99452f888 100644 --- a/test/setup/DBBackupTest.php +++ b/test/setup/DBBackupTest.php @@ -51,6 +51,6 @@ class DBBackupTest extends ItopTestCase $oConfigToTest->Set('db_tls.ca', $sTestCa); $sCliArgsCapathCfg = DBBackup::GetMysqlCliTlsOptions($oConfigToTest); $this->assertStringStartsWith(' --ssl', $sCliArgsMinCfg); - $this->assertStringEndsWith('--ssl-ca="'.$sTestCa.'"', $sCliArgsCapathCfg); + $this->assertStringEndsWith('--ssl-ca='.DBBackup::EscapeShellArg($sTestCa), $sCliArgsCapathCfg); } }