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); }); });