rule = new ChaperonServiceStatusRule(); } public function testReturnsTrueWhenBegleitpersonInAdditionalServices(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'Skibegleitperson Kurs'; $participant->additionalServices = [$service]; $this->assertTrue($this->rule->evaluate($participant)); } public function testReturnsTrueWhenBegleitpersonInCourses(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'Begleitperson Anfängerkurs'; $participant->courses = [$service]; $this->assertTrue($this->rule->evaluate($participant)); } public function testReturnsTrueWhenBegleitpersonInBoard(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'Halbpension Begleitperson'; $participant->board = [$service]; $this->assertTrue($this->rule->evaluate($participant)); } public function testReturnsTrueWhenBegleitpersonInRentals(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'Skiset Begleitperson'; $participant->rentals = [$service]; $this->assertTrue($this->rule->evaluate($participant)); } public function testReturnsTrueWhenBegleitpersonInSkiPass(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'Skipass Begleitperson 6 Tage'; $participant->skiPass = $service; $this->assertTrue($this->rule->evaluate($participant)); } public function testReturnsTrueWhenBegleitpersonInVeg(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'Vegetarisch Begleitperson'; $participant->veg = $service; $this->assertTrue($this->rule->evaluate($participant)); } public function testReturnsFalseWhenNoBegleitpersonService(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'Skipass 6 Tage Erwachsene'; $participant->skiPass = $service; $this->assertFalse($this->rule->evaluate($participant)); } public function testReturnsFalseWithEmptyServices(): void { $participant = new ParticipantDto(); $this->assertFalse($this->rule->evaluate($participant)); } public function testCaseInsensitiveMatch(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'BEGLEITPERSON Kurs'; $participant->additionalServices = [$service]; $this->assertTrue($this->rule->evaluate($participant)); } public function testMixedCaseMatch(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = 'beGleitPerson Kurs'; $participant->courses = [$service]; $this->assertTrue($this->rule->evaluate($participant)); } public function testReturnsStatusO(): void { $this->assertSame('O', $this->rule->getStatus()); } public function testGetPriorityReturns100(): void { $this->assertSame(100, $this->rule->getPriority()); } public function testGetDescriptionReturnsNonEmptyString(): void { $description = $this->rule->getDescription(); $this->assertIsString($description); $this->assertNotEmpty($description); } public function testHandlesNullLabel(): void { $participant = new ParticipantDto(); $service = new Service(); $service->label = null; $participant->additionalServices = [$service]; $this->assertFalse($this->rule->evaluate($participant)); } public function testMultipleServicesWithOneBegleitperson(): void { $participant = new ParticipantDto(); $normalService = new Service(); $normalService->label = 'Skipass 6 Tage'; $begleitpersonService = new Service(); $begleitpersonService->label = 'Skipass Begleitperson'; $participant->additionalServices = [$normalService, $begleitpersonService]; $this->assertTrue($this->rule->evaluate($participant)); } }