mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 16:48:42 +02:00
enhance test sdk: add GetTemporaryFilePath
# Conflicts: # tests/php-unit-tests/src/BaseTestCase/ItopTestCase.php
This commit is contained in:
@@ -730,6 +730,18 @@ abstract class ItopTestCase extends KernelTestCase
|
||||
return $this->CallUrl($sUrl, $aPostFields, $aCurlOptions, $bXDebugEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a temporary file path. that will be cleaned up by tearDown()
|
||||
* @return string: temporary file path
|
||||
*/
|
||||
public function GetTemporaryFilePath(string $sPrefix = "test"): string
|
||||
{
|
||||
|
||||
$sPath = tempnam(sys_get_temp_dir(), $sPrefix);
|
||||
$this->aFileToClean[] = $sPath;
|
||||
return $sPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $sXML
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user