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:
mmokhi 2019-05-23 12:47:28 +02:00 committed by Fabien Potencier
parent c3ad35b78a
commit 2a9816f0b6
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ class LoggerTest extends TestCase
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);
}