feat: add the product code to the travel export
This commit is contained in:
1 parent
6f6bf3695c
commit
6d2db1b258
3 files changed
+27
No files matched your search
@@ -42,6 +42,7 @@ class TravelExportBuilderTest extends TestCase
|
||||
self::assertSame(900, $row['busProId']);
|
||||
self::assertIsInt($row['busProId']);
|
||||
self::assertSame('SBW261226', $row['code']);
|
||||
self::assertSame('SBW', $row['productCode']);
|
||||
self::assertSame('Semesterende - Portes du Soleil', $row['product'], 'the product label is trimmed');
|
||||
self::assertSame('2026-12-26', $row['dateFrom']);
|
||||
self::assertSame('2026-12-30', $row['dateTo']);
|
||||
@@ -56,6 +57,21 @@ class TravelExportBuilderTest extends TestCase
|
||||
], $row['hotel']);
|
||||
}
|
||||
|
||||
public function testCarriesTheProductCodeOfTheEnclosingTravelRatherThanTheDateCode(): void
|
||||
{
|
||||
$rows = $this->build('<?xml version="1.0"?><reisen><reise code="DWWMP "><termin idbuspro="1" termin="01.01.2027" bis="02.01.2027" code="DWWMW010127"><hotel idbuspro="1"/></termin></reise></reisen>')->rows;
|
||||
|
||||
self::assertSame('DWWMP', $rows[0]['productCode'], 'taken from <reise>, trimmed');
|
||||
self::assertSame('DWWMW010127', $rows[0]['code']);
|
||||
}
|
||||
|
||||
public function testTheProductCodeIsNullWhenTheTravelCarriesNone(): void
|
||||
{
|
||||
$rows = $this->build('<?xml version="1.0"?><reisen><reise code=""><termin idbuspro="1" termin="01.01.2027" bis="02.01.2027" code="SCE010127"><hotel idbuspro="1"/></termin></reise></reisen>')->rows;
|
||||
|
||||
self::assertNull($rows[0]['productCode']);
|
||||
}
|
||||
|
||||
public function testResolvesBothZeitShapesAndRollsAnOvernightPickupOntoTheNextDay(): void
|
||||
{
|
||||
$pickups = array_column($this->rowFor('900-1')['pickups'], null, 'busProId');
|
||||
|
||||
Reference in new issue
Block a user