Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/CompilerRuntimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class CompilerRuntimeTest extends TestCase
public function testCompiledFileUsesVersionedName(): void
{
$dir = $this->createTempDir();
$expr = 'field' . str_replace('.', '', uniqid('', true));
$expr = 'field' . bin2hex(random_bytes(12));
$runtime = new CompilerRuntime($dir);

try {
Expand All @@ -36,7 +36,7 @@ public function testFunctionNameUsesVersionedSalt(): void

private function createTempDir()
{
$dir = sys_get_temp_dir() . '/jmespath-compiler-' . uniqid('', true);
$dir = sys_get_temp_dir() . '/jmespath-compiler-' . bin2hex(random_bytes(12));
mkdir($dir);

return realpath($dir);
Expand Down
4 changes: 2 additions & 2 deletions tests/DebugRuntimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DebugRuntimeTest extends TestCase
public function testCompiledDebugOutputUsesCustomCacheDirAndPreservesPercents(): void
{
$dir = $this->createTempDir();
$key = 'x%sy%%z' . str_replace('.', '', uniqid('', true));
$key = 'x%sy%%z' . bin2hex(random_bytes(12));
$expr = json_encode($key);
$out = fopen('php://memory', 'w+');

Expand All @@ -36,7 +36,7 @@ public function testCompiledDebugOutputUsesCustomCacheDirAndPreservesPercents():

private function createTempDir()
{
$dir = sys_get_temp_dir() . '/jmespath-debug-' . uniqid('', true);
$dir = sys_get_temp_dir() . '/jmespath-debug-' . bin2hex(random_bytes(12));
mkdir($dir);

return realpath($dir);
Expand Down
2 changes: 1 addition & 1 deletion tests/EnvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testCleansCompileDirWhenCompileEnvIsOn(): void
$serverValue = $serverExists ? $_SERVER[Env::COMPILE_DIR] : null;
$_SERVER[Env::COMPILE_DIR] = 'on';

$expr = 'env' . str_replace('.', '', uniqid('', true));
$expr = 'env' . bin2hex(random_bytes(12));
$filename = sys_get_temp_dir() . '/' . CompilerRuntime::functionName($expr) . '.php';
$runtime = new CompilerRuntime(sys_get_temp_dir());

Expand Down
Loading