Koha-clms/t/Koha
Tomás Cohen Arazi 8895b74bee
Bug 41619: Add Koha::CSV
This patch introduces Koha::CSV, a wrapper around Text::CSV_XS that
provides consistent defaults and methods for CSV generation across Koha.

The class:
- Inherits CSV delimiter from CSVDelimiter system preference
- Enforces security defaults (binary=1, formula='empty')
- Provides convenient methods for common CSV operations
- Allows per-instance configuration overrides

This establishes a foundation for standardizing CSV exports throughout
Koha, eliminating inconsistencies in CSV generation and providing a
testable, maintainable approach to CSV handling.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove t/Koha/CSV.t
=> SUCCESS: Tests pass!
3. Tests cover:
   - Default initialization with CSVDelimiter preference
   - Preference value inheritance (comma, semicolon, tabulation)
   - Constructor parameter overrides
   - add_row() method with various data types
   - combine() and string() methods
   - print() to filehandle
   - Proper quote escaping and empty field handling
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-06 15:17:02 -07:00
..
Auth Bug 40364: Add new permission to t/Koha/Auth/Permissions.t 2026-01-30 10:54:18 -07:00
Authority Bug 38944: Add Test::NoWarnings to tests no producing warnings 2025-03-13 17:25:03 +01:00
Database Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
DateTime/Format Bug 38944: Manual changes 2025-03-13 17:25:04 +01:00
I18N/po/xx_XX/LC_MESSAGES
…
Installer Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Middleware Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Object Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Plugins Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
REST/Plugin Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
Result Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
SearchEngine Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Util Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
CSV.t Bug 41619: Add Koha::CSV 2026-02-06 15:17:02 -07:00
Config.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Email.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Exceptions.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
I18N.t Bug 36947: Add system preference for configurable locale-based facet sorting 2025-07-11 15:26:56 -06:00
ItemType.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Manual.t Bug 40845: Remove hardcoded Koha version from t/Koha/Manual.t 2025-10-31 15:26:09 -06:00
Script.t Bug 40943: Fix t/Koha/Script.t 2025-11-07 07:43:52 -07:00
Script_cron.t Bug 40943: Fix Script_cron.t 2025-11-04 07:15:11 -07:00
Z3950responder.t Bug 38944: Add Test::NoWarnings to tests no producing warnings 2025-03-13 17:25:03 +01:00
sleep.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
wait.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00