Koha-clms/t/db_dependent/SIP
Tomás Cohen Arazi 053eb8855f
Bug 40915: Add comprehensive regression tests for SIP MsgType message parsing and debug logging
These tests verify that C4::SIP::Sip::MsgType correctly parses SIP messages without
creating problematic arrayref field values, and validates enhanced debug logging for
empty critical fields.

Test Coverage:
• Message parsing with correct protocol versions (PATRON_INFO/HOLD/RENEW use v2, CHECKOUT
uses v1)
• Empty patron_id and item_id field detection with debug logging
• Malformed delimiter handling (double delimiters, trailing empty fields)
• Multiple consecutive empty fields in single message
• Confusing delimiter patterns that could break parsing
• Verification that parsed fields are strings, not arrayrefs
• Working siplog mock infrastructure in C4::SIP::Sip::MsgType

Arrayref Prevention Tests:
Tests verify message parsing DOESN'T create empty arrayrefs that would later cause "Odd
number of elements in anonymous hash" errors when passed to Koha::Objects->find()
operations.

Enhanced Debug Logging Tests:
Tests validate that empty critical fields (patron_id, item_id) are detected during
parsing and generate appropriate debug messages to help troubleshoot downstream
constraint errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2026-03-18 15:57:49 +13:00
..
ILS.t Rmaint fix: Fix number of tests in ILS.t 2023-10-18 08:17:10 +00:00
Message.t Bug 34848: (QA follow-up) Resolve warn on useless constant 2023-10-17 12:20:41 +01:00
MsgType.t Bug 40915: Add comprehensive regression tests for SIP MsgType message parsing and debug logging 2026-03-18 15:57:49 +13:00
Patron.t Bug 33411: (follow-up) Set debit type for mocked fines 2023-06-12 10:14:45 +00:00
SIPServer.t
…
Transaction.t Bug 32408: Add unit tests to SIP checkout 2023-02-09 12:08:07 -01:00