seedConfig(); $parentId = $this->seedParent(); $service = new ParentEmergencyContactService(new ParentConfigService, new PhoneFormatterService); $contact = $service->store($parentId, [ 'name' => 'Sam Contact', 'cellphone' => '1234567890', 'email' => 'sam@example.com', 'relation' => 'Uncle', ]); $this->assertSame('Sam Contact', $contact['emergency_contact_name']); $this->assertDatabaseHas('emergency_contacts', ['parent_id' => $parentId, 'emergency_contact_name' => 'Sam Contact']); } private function seedParent(): int { return DB::table('users')->insertGetId([ 'firstname' => 'Parent', 'lastname' => 'User', 'cellphone' => '1234567890', 'email' => 'parent5@example.com', 'address_street' => '123 Street', 'city' => 'City', 'state' => 'ST', 'zip' => '12345', 'accept_school_policy' => 1, 'password' => bcrypt('password'), 'user_type' => 'primary', 'semester' => 'Fall', 'school_year' => '2025-2026', 'status' => 'Active', ]); } private function seedConfig(): void { DB::table('configuration')->insert([ ['config_key' => 'school_year', 'config_value' => '2025-2026'], ['config_key' => 'semester', 'config_value' => 'Fall'], ]); } }