*/ class TimesheetValidatorTest extends ConstraintValidatorTestCase { protected function createValidator(): TimesheetValidator { return $this->createMyValidator(); } protected function createMyValidator(bool $isGranted = true): TimesheetValidator { return new TimesheetValidator([]); } public function testConstraintIsInvalid() { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new Timesheet(), new NotBlank()); } public function testInvalidValueThrowsException() { $this->expectException(UnexpectedTypeException::class); $this->validator->validate(new NotBlank(), new TimesheetConstraint(['message' => 'myMessage'])); // @phpstan-ignore-line } }