fix: validate body dimensions when rentals are selected only

This commit is contained in:
Björn Fromme
2026-06-02 14:22:47 +02:00
parent f023bd9772
commit 00889318ee
2 changed files with 37 additions and 2 deletions
@@ -89,6 +89,34 @@ class ParticipantValidatorTest extends ConstraintValidatorTestCase
$this->assertNoViolation();
}
public function testParticipantWithoutRentalsIgnoresOutOfRangeBodyMeasurements(): void
{
$participant = $this->createValidParticipant();
$participant->rentals = [];
$participant->height = '999';
$participant->weight = '999';
$participant->shoeSize = '999';
$this->validator->validate($participant, new Participant());
$this->assertNoViolation();
}
public function testParticipantWithRentalsAndOutOfRangeShoeSizeFailsValidation(): void
{
$participant = $this->createValidParticipant();
$participant->rentals = [$this->createMockService()];
$participant->height = '170';
$participant->weight = '70';
$participant->shoeSize = '51';
$this->validator->validate($participant, new Participant());
$this->buildViolation('Bitte gib eine Zahl zwischen 35 und 50 ein. Falls du außerhalb dieses Bereichs bist, ruf gerne unser Kundenoffice an.')
->atPath('property.path.shoeSize')
->assertRaised();
}
public function testCanceledParticipantSkipsValidation(): void
{
$participant = $this->createValidParticipant();