feat: make body dimensions optional even with rentals selected
This commit is contained in:
@@ -31,7 +31,7 @@ class ParticipantValidatorTest extends ConstraintValidatorTestCase
|
||||
$this->assertNoViolation();
|
||||
}
|
||||
|
||||
public function testParticipantWithRentalsButNoHeightFailsValidation(): void
|
||||
public function testParticipantWithRentalsAndMissingHeightPassesValidation(): void
|
||||
{
|
||||
$participant = $this->createValidParticipant();
|
||||
$participant->rentals = [$this->createMockService()];
|
||||
@@ -41,12 +41,10 @@ class ParticipantValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
$this->validator->validate($participant, new Participant());
|
||||
|
||||
$this->buildViolation('Bitte auswählen')
|
||||
->atPath('property.path.height')
|
||||
->assertRaised();
|
||||
$this->assertNoViolation();
|
||||
}
|
||||
|
||||
public function testParticipantWithRentalsButNoWeightFailsValidation(): void
|
||||
public function testParticipantWithRentalsAndMissingWeightPassesValidation(): void
|
||||
{
|
||||
$participant = $this->createValidParticipant();
|
||||
$participant->rentals = [$this->createMockService()];
|
||||
@@ -56,12 +54,10 @@ class ParticipantValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
$this->validator->validate($participant, new Participant());
|
||||
|
||||
$this->buildViolation('Bitte auswählen')
|
||||
->atPath('property.path.weight')
|
||||
->assertRaised();
|
||||
$this->assertNoViolation();
|
||||
}
|
||||
|
||||
public function testParticipantWithRentalsButNoShoeSizeFailsValidation(): void
|
||||
public function testParticipantWithRentalsAndMissingShoeSizePassesValidation(): void
|
||||
{
|
||||
$participant = $this->createValidParticipant();
|
||||
$participant->rentals = [$this->createMockService()];
|
||||
@@ -71,9 +67,7 @@ class ParticipantValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
$this->validator->validate($participant, new Participant());
|
||||
|
||||
$this->buildViolation('Bitte auswählen')
|
||||
->atPath('property.path.shoeSize')
|
||||
->assertRaised();
|
||||
$this->assertNoViolation();
|
||||
}
|
||||
|
||||
public function testParticipantWithoutRentalsAndNoBodyMeasurementsPassesValidation(): void
|
||||
@@ -89,7 +83,7 @@ class ParticipantValidatorTest extends ConstraintValidatorTestCase
|
||||
$this->assertNoViolation();
|
||||
}
|
||||
|
||||
public function testParticipantWithoutRentalsIgnoresOutOfRangeBodyMeasurements(): void
|
||||
public function testParticipantWithoutRentalsAndOutOfRangeBodyMeasurementsPassValidation(): void
|
||||
{
|
||||
$participant = $this->createValidParticipant();
|
||||
$participant->rentals = [];
|
||||
|
||||
Reference in New Issue
Block a user