insert([ 'id' => 1, 'event_name' => 'Trip', 'event_category' => 'field trips', 'amount' => 25, 'expiration_date' => '2025-02-01', 'semester' => 'Fall', 'school_year' => '2025-2026', 'created_at' => now(), 'updated_at' => now(), ]); DB::table('students')->insert([ 'id' => 1, 'parent_id' => 10, 'firstname' => 'Kid', 'lastname' => 'One', ]); DB::table('enrollments')->insert([ 'id' => 1, 'student_id' => 1, 'parent_id' => 10, 'class_section_id' => 101, 'enrollment_status' => 'enrolled', 'school_year' => '2025-2026', ]); $invoiceService = Mockery::mock(InvoiceGenerationService::class); $invoiceService->shouldReceive('generateInvoice')->andReturn(['ok' => true]); $service = new EventChargeService($invoiceService); $event = Event::query()->findOrFail(1); $service->seedChargesForEvent($event, '2025-2026', 'Fall', 25, 1); $this->assertDatabaseHas('event_charges', [ 'event_id' => 1, 'student_id' => 1, ]); } }