Files
michaelschiemer/tests/Framework/Discovery/DiscoveryCacheTest.php
Michael Schiemer 55a330b223 Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
2025-08-11 20:13:26 +02:00

44 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
use App\Framework\Cache\Cache;
use App\Framework\Core\ValueObjects\Timestamp;
use App\Framework\Discovery\Storage\DiscoveryCacheManager;
use App\Framework\Discovery\ValueObjects\DiscoveryContext;
use App\Framework\Discovery\ValueObjects\DiscoveryOptions;
use App\Framework\Discovery\ValueObjects\ScanType;
use App\Framework\Filesystem\FileSystemService;
beforeEach(function () {
$this->mockCache = Mockery::mock(Cache::class);
$this->mockClock = Mockery::mock(\App\Framework\DateTime\Clock::class);
$this->realFileSystemService = new FileSystemService(); // Use real service since it's final
$this->mockClock->shouldReceive('time')->andReturn(Timestamp::fromFloat(microtime(true)))->byDefault();
$this->mockClock->shouldReceive('now')->andReturn(new \DateTimeImmutable())->byDefault();
$this->discoveryCacheManager = new DiscoveryCacheManager(
$this->mockCache,
$this->mockClock,
$this->realFileSystemService
);
// Create test context
$this->testContext = new DiscoveryContext(
paths: ['/test/path'],
scanType: ScanType::FULL,
options: new DiscoveryOptions(),
startTime: $this->mockClock->now()
);
});
afterEach(function () {
Mockery::close();
});
describe('Basic Cache Operations', function () {
it('cache manager can be instantiated', function () {
expect($this->discoveryCacheManager)->toBeInstanceOf(DiscoveryCacheManager::class);
});
});