@@ -201,7 +201,7 @@ public function MakeNameProvider(): array
201201 * @covers DBBackup::GetTmpDir
202202 * @dataProvider GetTmpDirProvider
203203 */
204- public function testGetTmpDir (string $ sTmpDir , string $ sStartsWith ): void
204+ public function testGetTmpDir (? string $ sTmpDir , string $ sStartsWith ): void
205205 {
206206 $ this ->RequireOnceItopFile ('setup/setuputils.class.inc.php ' );
207207 $ oConfig = \utils::GetConfig (true );
@@ -217,6 +217,10 @@ public function testGetTmpDir(string $sTmpDir, string $sStartsWith): void
217217 public function GetTmpDirProvider (): array
218218 {
219219 return [
220+ 'Not configured ' => [
221+ null ,
222+ static ::GetAppRoot () . 'data/itop-backup ' ,
223+ ],
220224 'Default settings ' => [
221225 'data/ ' ,
222226 static ::GetAppRoot () . 'data/itop-backup ' ,
@@ -225,17 +229,9 @@ public function GetTmpDirProvider(): array
225229 '' ,
226230 sys_get_temp_dir () . '/itop-backup ' ,
227231 ],
228- 'System directory attempt with existing root dir ' => [
229- '/lib ' ,
230- static ::GetAppRoot () . 'lib/itop-backup ' ,
231- ],
232- 'System directory attempt with non existing root dir ' => [
233- '/etc ' ,
234- static ::GetAppRoot () . 'data/itop-backup ' ,
235- ],
236- 'Breakout attempt ' => [
237- '../../../var ' ,
238- static ::GetAppRoot () . 'data/itop-backup ' ,
232+ 'Fixed system directory ' => [
233+ '/tmp ' ,
234+ '/tmp/itop-backup ' ,
239235 ],
240236 ];
241237 }
0 commit comments