chore: major code cleanup and type safety using phpstan
This commit is contained in:
1 parent
060cbea9da
commit
3da73d626b
103 files changed
+976
-1192
No files matched your search
@@ -38,7 +38,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertFalse($result, 'Insurance should always be editable in create flow');
|
||||
self::assertFalse($result, 'Insurance should always be editable in create flow');
|
||||
}
|
||||
|
||||
public function testReadonlyWhen40DaysBeforeTravel(): void
|
||||
@@ -51,7 +51,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
self::assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testReadonlyWhenExactly30DaysBeforeTravel(): void
|
||||
@@ -65,7 +65,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
self::assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testReadonlyWhen20DaysBeforeTravel(): void
|
||||
@@ -78,7 +78,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertTrue($result, 'Insurance should be readonly when 20 days before travel (standard case)');
|
||||
self::assertTrue($result, 'Insurance should be readonly when 20 days before travel (standard case)');
|
||||
}
|
||||
|
||||
public function testReadonlyWhen2DaysAfterLateBooking(): void
|
||||
@@ -92,7 +92,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
self::assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testReadonlyWhenExactly3DaysAfterLateBooking(): void
|
||||
@@ -106,7 +106,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
self::assertTrue($result, 'Insurance should be readonly in edit mode (API limitation)');
|
||||
}
|
||||
|
||||
public function testReadonlyWhen5DaysAfterLateBooking(): void
|
||||
@@ -120,7 +120,7 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertTrue($result, 'Insurance should be readonly 5 days after late booking');
|
||||
self::assertTrue($result, 'Insurance should be readonly 5 days after late booking');
|
||||
}
|
||||
|
||||
public function testReadonlyWhenTravelDatePassed(): void
|
||||
@@ -133,24 +133,24 @@ class InsuranceMutabilityConditionTest extends TestCase
|
||||
|
||||
$result = $this->condition->evaluate($bookingDto, 0, []);
|
||||
|
||||
$this->assertTrue($result, 'Insurance should be readonly when travel date has passed');
|
||||
self::assertTrue($result, 'Insurance should be readonly when travel date has passed');
|
||||
}
|
||||
|
||||
public function testGetDependentFieldsReturnsEmptyArray(): void
|
||||
{
|
||||
$result = $this->condition->getDependentFields();
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertEmpty($result, 'Insurance mutability has no field dependencies');
|
||||
self::assertIsArray($result);
|
||||
self::assertEmpty($result, 'Insurance mutability has no field dependencies');
|
||||
}
|
||||
|
||||
public function testGetDescriptionReturnsString(): void
|
||||
{
|
||||
$result = $this->condition->getDescription();
|
||||
|
||||
$this->assertIsString($result);
|
||||
$this->assertStringContainsString('not editable', $result);
|
||||
$this->assertStringContainsString('edit mode', $result);
|
||||
self::assertIsString($result);
|
||||
self::assertStringContainsString('not editable', $result);
|
||||
self::assertStringContainsString('edit mode', $result);
|
||||
}
|
||||
|
||||
private function createEditDto(\DateTimeImmutable $travelDate, \DateTimeImmutable $bookingDate): BookingDto
|
||||
|
||||
Reference in new issue
Block a user