assertSame( 'Saison 2026/27 - Rotbach', $this->labeler()->label($this->seasonAssignment('2026-11-01', 'AGR')) ); } /** * The season window is 01.11.-01.04., so a placement starting in July belongs to no season. * It still has to name itself rather than render blank. */ public function testAPlacementOutsideAnySeasonSaysSo(): void { $this->assertSame( 'außerhalb der Saison - Rotbach', $this->labeler()->label($this->seasonAssignment('2027-07-15', 'AGR')) ); } public function testAHalfFilledRecordStillNamesItself(): void { $this->assertSame('? - ?', $this->labeler()->label(new SeasonAssignment())); } /** * The houses map is curated and can lose an entry; a placement that named that house falls * back to the raw code rather than losing its name. */ public function testACodeThatLeftTheMapFallsBackToTheCode(): void { $this->assertSame( 'Saison 2026/27 - XYZ', $this->labeler()->label($this->seasonAssignment('2026-11-01', 'XYZ')) ); } private function labeler(): SeasonAssignmentLabeler { return new SeasonAssignmentLabeler( new SeasonCalendar('11-01', '04-01'), new HouseCatalog(['AGR' => 'Rotbach']) ); } private function seasonAssignment(string $dateFrom, string $hotelCode): SeasonAssignment { return (new SeasonAssignment()) ->setDateFrom(new \DateTimeImmutable($dateFrom)) ->setDateTo(new \DateTimeImmutable($dateFrom.' +5 months')) ->setHotelCode($hotelCode) ; } }