Some checks failed
Deploy Application / deploy (push) Has been cancelled
37 lines
1.2 KiB
PHP
37 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Framework\Discovery\Storage\ValueObjects;
|
|
|
|
use App\Framework\Discovery\Storage\ValueObjects\StalenessCheckResult;
|
|
|
|
describe('StalenessCheckResult', function () {
|
|
it('creates fresh result', function () {
|
|
$result = StalenessCheckResult::fresh();
|
|
|
|
expect($result->isStale)->toBeFalse();
|
|
expect($result->isFresh())->toBeTrue();
|
|
expect($result->reason)->toBeNull();
|
|
expect($result->modifiedPaths)->toBe([]);
|
|
});
|
|
|
|
it('creates stale result with reason', function () {
|
|
$result = StalenessCheckResult::stale('directory_modified', ['/path/to/src']);
|
|
|
|
expect($result->isStale)->toBeTrue();
|
|
expect($result->isFresh())->toBeFalse();
|
|
expect($result->reason)->toBe('directory_modified');
|
|
expect($result->modifiedPaths)->toBe(['/path/to/src']);
|
|
});
|
|
|
|
it('creates stale result without paths', function () {
|
|
$result = StalenessCheckResult::stale('incremental_scan');
|
|
|
|
expect($result->isStale)->toBeTrue();
|
|
expect($result->reason)->toBe('incremental_scan');
|
|
expect($result->modifiedPaths)->toBe([]);
|
|
});
|
|
});
|
|
|