mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
sync latest changes
This commit is contained in:
@ -46,6 +46,7 @@ declare(strict_types=1);
|
|||||||
namespace PHPUnit\Runner\ResultCache;
|
namespace PHPUnit\Runner\ResultCache;
|
||||||
|
|
||||||
use const DIRECTORY_SEPARATOR;
|
use const DIRECTORY_SEPARATOR;
|
||||||
|
use const LOCK_EX;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestStatus\TestStatus;
|
use PHPUnit\Framework\TestStatus\TestStatus;
|
||||||
use PHPUnit\Runner\DirectoryCannotBeCreatedException;
|
use PHPUnit\Runner\DirectoryCannotBeCreatedException;
|
||||||
@ -65,6 +66,8 @@ use function json_encode;
|
|||||||
use function Pest\version;
|
use function Pest\version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
|
||||||
|
*
|
||||||
* @internal This class is not covered by the backward compatibility promise for PHPUnit
|
* @internal This class is not covered by the backward compatibility promise for PHPUnit
|
||||||
*/
|
*/
|
||||||
final class DefaultResultCache implements ResultCache
|
final class DefaultResultCache implements ResultCache
|
||||||
@ -77,12 +80,12 @@ final class DefaultResultCache implements ResultCache
|
|||||||
private readonly string $cacheFilename;
|
private readonly string $cacheFilename;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @psalm-var array<string, TestStatus>
|
* @var array<string, TestStatus>
|
||||||
*/
|
*/
|
||||||
private array $defects = [];
|
private array $defects = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @psalm-var array<string, float>
|
* @var array<string, float>
|
||||||
*/
|
*/
|
||||||
private array $times = [];
|
private array $times = [];
|
||||||
|
|
||||||
@ -119,6 +122,17 @@ final class DefaultResultCache implements ResultCache
|
|||||||
return $this->times[$id] ?? 0.0;
|
return $this->times[$id] ?? 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function mergeWith(self $other): void
|
||||||
|
{
|
||||||
|
foreach ($other->defects as $id => $defect) {
|
||||||
|
$this->defects[$id] = $defect;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($other->times as $id => $time) {
|
||||||
|
$this->times[$id] = $time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function load(): void
|
public function load(): void
|
||||||
{
|
{
|
||||||
if (! is_file($this->cacheFilename)) {
|
if (! is_file($this->cacheFilename)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user