createCurrentYearPeriod(); } public function testWhenUserIsCreatedThenVacationLimitIsCreatedForCurrentYearPeriod(): void { $this->assertDatabaseCount("vacation_limits", 0); $currentYearPeriod = YearPeriod::current(); $user = User::factory()->create(); $this->assertDatabaseCount("vacation_limits", 1); $this->assertDatabaseHas("vacation_limits", [ "user_id" => $user->id, "year_period_id" => $currentYearPeriod->id, ]); } public function testWhenYearPeriodIsCreatedThenVacationLimitsForThisYearPeriodAreCreated(): void { $this->assertDatabaseCount("vacation_limits", 0); User::factory(10)->createQuietly(); YearPeriod::factory()->create(); $this->assertDatabaseCount("vacation_limits", 10); } }