birth_date = now()->subYears(17)->toDateString(); $this->expectException(ValidationException::class); $this->expectExceptionMessage(__('validation.responsible_must_be_adult')); $responsible->fireSavingEvent(); } public function test_it_allows_an_adult_when_saving_the_model(): void { $responsible = new TestableStudentResponsible; $responsible->birth_date = now()->subYears(18)->toDateString(); $responsible->fireSavingEvent(); $this->assertSame(18, $responsible->birth_date->age); } } class TestableStudentResponsible extends StudentResponsible { public function fireSavingEvent(): mixed { return $this->fireModelEvent('saving'); } }