fix: skip snapshots of travels still available as XML from refreshing

This commit is contained in:
Björn Fromme
2026-03-23 19:15:45 +01:00
parent 77b16f287a
commit be43d30cc7
3 changed files with 39 additions and 3 deletions
@@ -408,6 +408,25 @@ class TravelSnapshotServiceTest extends TestCase
$this->assertSame(['processed' => 1, 'updated' => 0, 'failed' => 1], $result);
}
public function testRefreshSkipsSnapshotsWithXmlAvailable(): void
{
$payload = '{"id":100}';
$snapshot = new TravelSnapshot(100, 200, $payload, hash('sha256', $payload));
$this->snapshotRepository
->expects($this->once())
->method('findRefreshCandidates')
->willReturn([$snapshot]);
$this->apiClient
->expects($this->never())
->method('getAvailabilitiesExtended');
$result = $this->service->refreshExtendedSnapshots(500, false, 360, [100]);
$this->assertSame(['processed' => 0, 'updated' => 0, 'failed' => 0], $result);
}
public function testGenerateMappingBuildsCorrectStructure(): void
{
$hotel = new Hotel();