feat: refresh existing snapshots from XML after sync
This commit is contained in:
@@ -336,7 +336,7 @@ class TravelSnapshotServiceTest extends TestCase
|
||||
->expects($this->once())
|
||||
->method('flush');
|
||||
|
||||
$result = $this->service->refreshExtendedSnapshots();
|
||||
$result = $this->service->refreshExtendedSnapshots(500, false, 360, []);
|
||||
|
||||
$this->assertSame(['processed' => 1, 'updated' => 1, 'failed' => 0], $result);
|
||||
}
|
||||
@@ -374,7 +374,7 @@ class TravelSnapshotServiceTest extends TestCase
|
||||
->expects($this->never())
|
||||
->method('flush');
|
||||
|
||||
$result = $this->service->refreshExtendedSnapshots();
|
||||
$result = $this->service->refreshExtendedSnapshots(500, false, 360, []);
|
||||
|
||||
$this->assertSame(['processed' => 1, 'updated' => 0, 'failed' => 1], $result);
|
||||
}
|
||||
@@ -403,11 +403,34 @@ class TravelSnapshotServiceTest extends TestCase
|
||||
->expects($this->never())
|
||||
->method('flush');
|
||||
|
||||
$result = $this->service->refreshExtendedSnapshots();
|
||||
$result = $this->service->refreshExtendedSnapshots(500, false, 360, []);
|
||||
|
||||
$this->assertSame(['processed' => 1, 'updated' => 0, 'failed' => 1], $result);
|
||||
}
|
||||
|
||||
public function testRefreshSkipsAllCandidatesWhenXmlDateIdsIsNull(): 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');
|
||||
|
||||
$this->entityManager
|
||||
->expects($this->never())
|
||||
->method('flush');
|
||||
|
||||
$result = $this->service->refreshExtendedSnapshots(500, false, 360, null);
|
||||
|
||||
$this->assertSame(['processed' => 0, 'updated' => 0, 'failed' => 0], $result);
|
||||
}
|
||||
|
||||
public function testRefreshSkipsSnapshotsWithXmlAvailable(): void
|
||||
{
|
||||
$payload = '{"id":100}';
|
||||
|
||||
Reference in New Issue
Block a user