mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
fix: cache being mixed with phpunit
This commit is contained in:
@ -47,6 +47,7 @@ namespace PHPUnit\Runner\ResultCache;
|
||||
|
||||
use function array_keys;
|
||||
use function assert;
|
||||
use function Pest\version;
|
||||
use const DIRECTORY_SEPARATOR;
|
||||
use function dirname;
|
||||
use function file_get_contents;
|
||||
@ -66,11 +67,6 @@ use PHPUnit\Util\Filesystem;
|
||||
*/
|
||||
final class DefaultResultCache implements ResultCache
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private const VERSION = 1;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@ -138,7 +134,7 @@ final class DefaultResultCache implements ResultCache
|
||||
return;
|
||||
}
|
||||
|
||||
if ($data['version'] !== self::VERSION) {
|
||||
if ($data['version'] !== $this->cacheVersion()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -163,7 +159,7 @@ final class DefaultResultCache implements ResultCache
|
||||
}
|
||||
|
||||
$data = [
|
||||
'version' => self::VERSION,
|
||||
'version' => $this->cacheVersion(),
|
||||
'defects' => [],
|
||||
'times' => $this->times,
|
||||
];
|
||||
@ -178,4 +174,12 @@ final class DefaultResultCache implements ResultCache
|
||||
LOCK_EX
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the cache version.
|
||||
*/
|
||||
private function cacheVersion(): string
|
||||
{
|
||||
return 'pest_' . version();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user