From ae394aea51a850a4507805086bcea33d04254dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radovan=20Kep=C3=A1k?= Date: Thu, 24 Oct 2024 01:39:13 +0200 Subject: [PATCH] TestHandler: improve cache file uniqueness (#454) Use full length of MD5 to make collisions more difficult --- src/Runner/TestHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runner/TestHandler.php b/src/Runner/TestHandler.php index 1b38068f..a4a0f041 100644 --- a/src/Runner/TestHandler.php +++ b/src/Runner/TestHandler.php @@ -176,7 +176,7 @@ private function initiateTestCase(Test $test, $foo, PhpInterpreter $interpreter) $methods = null; if ($this->tempDir) { - $cacheFile = $this->tempDir . DIRECTORY_SEPARATOR . 'TestHandler.testCase.' . substr(md5($test->getSignature()), 0, 5) . '.list'; + $cacheFile = $this->tempDir . DIRECTORY_SEPARATOR . 'TestHandler.testCase.' . md5($test->getSignature()) . '.list'; if (is_file($cacheFile)) { $cache = unserialize(file_get_contents($cacheFile));