updates dependencies and snapshots

This commit is contained in:
Nuno Maduro
2025-07-22 23:51:32 +01:00
parent 21e22decf3
commit f9901245f1
10 changed files with 31 additions and 26 deletions

View File

@ -18,19 +18,19 @@
],
"require": {
"php": "^8.3.0",
"brianium/paratest": "^7.10.3",
"brianium/paratest": "^7.11.0",
"nunomaduro/collision": "^8.8.2",
"nunomaduro/termwind": "^2.3.1",
"pestphp/pest-plugin": "^4.0.0",
"pestphp/pest-plugin-arch": "^4.0.0",
"pestphp/pest-plugin-mutate": "^4.0.0",
"pestphp/pest-plugin-profanity": "^4.0.0",
"phpunit/phpunit": "^12.2.6",
"phpunit/phpunit": "^12.2.7",
"symfony/process": "^7.3.0"
},
"conflict": {
"filp/whoops": "<2.18.3",
"phpunit/phpunit": ">12.2.6",
"phpunit/phpunit": ">12.2.7",
"sebastian/exporter": "<7.0.0",
"webmozart/assert": "<1.11.0"
},

View File

@ -49,7 +49,7 @@ use const DIRECTORY_SEPARATOR;
use const LOCK_EX;
use PHPUnit\Framework\TestStatus\TestStatus;
use PHPUnit\Runner\DirectoryCannotBeCreatedException;
use PHPUnit\Runner\DirectoryDoesNotExistException;
use PHPUnit\Runner\Exception;
use PHPUnit\Util\Filesystem;
@ -72,10 +72,7 @@ use function Pest\version;
*/
final class DefaultResultCache implements ResultCache
{
/**
* @var string
*/
private const DEFAULT_RESULT_CACHE_FILENAME = '.phpunit.result.cache';
private const string DEFAULT_RESULT_CACHE_FILENAME = '.phpunit.result.cache';
private readonly string $cacheFilename;
@ -98,28 +95,28 @@ final class DefaultResultCache implements ResultCache
$this->cacheFilename = $filepath ?? $_ENV['PHPUNIT_RESULT_CACHE'] ?? self::DEFAULT_RESULT_CACHE_FILENAME;
}
public function setStatus(string $id, TestStatus $status): void
public function setStatus(ResultCacheId $id, TestStatus $status): void
{
if ($status->isSuccess()) {
return;
}
$this->defects[$id] = $status;
$this->defects[$id->asString()] = $status;
}
public function status(string $id): TestStatus
public function status(ResultCacheId $id): TestStatus
{
return $this->defects[$id] ?? TestStatus::unknown();
return $this->defects[$id->asString()] ?? TestStatus::unknown();
}
public function setTime(string $id, float $time): void
public function setTime(ResultCacheId $id, float $time): void
{
$this->times[$id] = $time;
$this->times[$id->asString()] = $time;
}
public function time(string $id): float
public function time(ResultCacheId $id): float
{
return $this->times[$id] ?? 0.0;
return $this->times[$id->asString()] ?? 0.0;
}
public function mergeWith(self $other): void
@ -179,7 +176,7 @@ final class DefaultResultCache implements ResultCache
public function persist(): void
{
if (! Filesystem::createDirectory(dirname($this->cacheFilename))) {
throw new DirectoryCannotBeCreatedException($this->cacheFilename);
throw new DirectoryDoesNotExistException(dirname($this->cacheFilename));
}
$data = [

View File

@ -6,7 +6,7 @@ namespace Pest;
function version(): string
{
return '4.0.0-alpha.5';
return '4.0.0-alpha.6';
}
function testDirectory(string $file = ''): string

View File

@ -19,8 +19,8 @@ final class SnapshotRepository
* Creates a snapshot repository instance.
*/
public function __construct(
readonly private string $testsPath,
readonly private string $snapshotsPath,
private readonly string $testsPath,
private readonly string $snapshotsPath,
) {}
/**

View File

@ -124,6 +124,7 @@ final class Str
public static function slugify(string $target): string
{
$target = preg_replace('/[^a-zA-Z0-9]+/', '-', $target);
return strtolower(trim($target, '-'));
}
}

View File

@ -1,5 +1,5 @@
Pest Testing Framework 4.0.0-alpha.5.
Pest Testing Framework 4.0.0-alpha.6.
USAGE: pest <file> [options]

View File

@ -1,3 +1,3 @@
Pest Testing Framework 4.0.0-alpha.5.
Pest Testing Framework 4.0.0-alpha.6.

View File

@ -628,6 +628,13 @@
✓ pass
✓ failures
✓ failures with custom message
✓ not failures
PASS Tests\Features\Expect\toBeSlug
✓ pass
✓ failures
✓ failures with custom message
✓ failures with default message
✓ not failures
PASS Tests\Features\Expect\toBeSnakeCase
@ -1719,4 +1726,4 @@
WARN Tests\Visual\Version
- visual snapshot of help command output
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 38 todos, 33 skipped, 1149 passed (2742 assertions)
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 38 todos, 33 skipped, 1154 passed (2754 assertions)

View File

@ -16,7 +16,7 @@ $run = function () {
test('parallel', function () use ($run) {
expect($run('--exclude-group=integration'))
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 38 todos, 24 skipped, 1139 passed (2718 assertions)')
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 38 todos, 24 skipped, 1144 passed (2730 assertions)')
->toContain('Parallel: 3 processes');
})->skipOnWindows();