Skip to content

Commit

Permalink
TestHandler: improve cache file uniqueness (#454)
Browse files Browse the repository at this point in the history
Use full length of MD5 to make collisions more difficult
  • Loading branch information
bckp authored and dg committed Oct 23, 2024
1 parent ce899ed commit ae394ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Runner/TestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit ae394ae

Please sign in to comment.