Make tempfile path unique
The temp-file that the test currently creates is `/tmp/log`. This may exist on many platforms already (including `platform.sh` app containers). With the proposed patch way the collision will be less likely. Sponsored-by: Platform.sh
This commit is contained in:
parent
c3ad35b78a
commit
2a9816f0b6
|
@ -34,7 +34,7 @@ class LoggerTest extends TestCase
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
$this->tmpFile = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'log';
|
$this->tmpFile = tempnam(sys_get_temp_dir(), 'log');
|
||||||
$this->logger = new Logger(LogLevel::DEBUG, $this->tmpFile);
|
$this->logger = new Logger(LogLevel::DEBUG, $this->tmpFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue