chore: adjust and cleanup tests
This commit is contained in:
@@ -41,7 +41,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
$this->assertFalse($result, 'Insurance should always be editable in create flow');
|
||||
}
|
||||
|
||||
public function testEditableWhen40DaysBeforeTravel(): void
|
||||
public function testReadonlyWhen40DaysBeforeTravel(): void
|
||||
{
|
||||
// Now is 2025-01-15, travel is 40 days later: 2025-02-24
|
||||
$travelDate = new \DateTimeImmutable('2025-02-24 12:00:00');
|
||||
@@ -51,10 +51,10 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertFalse($result, 'Insurance should be editable when 40 days before travel (standard case)');
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testEditableWhenExactly30DaysBeforeTravel(): void
|
||||
public function testReadonlyWhenExactly30DaysBeforeTravel(): void
|
||||
{
|
||||
// Now is fixed at 2025-01-15 12:00:00
|
||||
// Travel date exactly 30 days later: 2025-02-14 12:00:00
|
||||
@@ -65,7 +65,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertFalse($result, 'Insurance should be editable when exactly 30 days before travel (edge case)');
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testReadonlyWhen20DaysBeforeTravel(): void
|
||||
@@ -81,7 +81,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
$this->assertTrue($result, 'Insurance should be readonly when 20 days before travel (standard case)');
|
||||
}
|
||||
|
||||
public function testEditableWhen2DaysAfterLateBooking(): void
|
||||
public function testReadonlyWhen2DaysAfterLateBooking(): void
|
||||
{
|
||||
// Now is 2025-01-15, booking was 2 days ago: 2025-01-13
|
||||
// Travel is 15 days after booking: 2025-01-28 (late booking)
|
||||
@@ -92,10 +92,10 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertFalse($result, 'Insurance should be editable 2 days after late booking');
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testEditableWhenExactly3DaysAfterLateBooking(): void
|
||||
public function testReadonlyWhenExactly3DaysAfterLateBooking(): void
|
||||
{
|
||||
// Now is 2025-01-15, booking was exactly 3 days ago: 2025-01-12
|
||||
// Travel is 15 days after booking: 2025-01-27 (late booking)
|
||||
@@ -106,7 +106,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertFalse($result, 'Insurance should be editable exactly 3 days after late booking (edge case)');
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testReadonlyWhen5DaysAfterLateBooking(): void
|
||||
@@ -149,8 +149,8 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
$result = $this->condition->getDescription();
|
||||
|
||||
$this->assertIsString($result);
|
||||
$this->assertStringContainsString('30', $result);
|
||||
$this->assertStringContainsString('3', $result);
|
||||
$this->assertStringContainsString('not editable', $result);
|
||||
$this->assertStringContainsString('edit mode', $result);
|
||||
}
|
||||
|
||||
private function createEditDto(\DateTimeImmutable $travelDate, \DateTimeImmutable $bookingDate): BookingDto
|
||||
|
||||
Reference in New Issue
Block a user