https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43694

--- Comment #6 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 210252
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210252&action=edit
Bug 43694: (QA follow-up) Validate generated messages against the XSD

This patch adds a copy of the ISO 18626 2021-3 XSD to
t/db_dependent/data/iso18626 and a 'xml_with_envelope() schema
validation tests' subtest that builds one message of each of the six
ISO 18626 message types and validates the generated XML against it.

The JSON-level validation in Koha::ILL::ISO18626::is_invalid cannot
catch element order problems, as JSON objects are unordered. Validating
the XML on the wire against the official schema covers this class of
bugs.

The published 2021-3 XSD does not compile: the sentToPatron element
uses type="xs:type_yesNo", which resolves to a type in the XML Schema
namespace that does not exist. The Koha copy uses type="type_yesNo"
instead, and a comment at the top of the file documents the change.
Line endings were also converted to LF, tabs expanded to 4 spaces and
trailing whitespace removed, as required by the QA tools.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove -v t/db_dependent/Koha/ILL/ISO18626.t
=> SUCCESS: Tests pass! All six message types validate
3. Revert the fix from the previous patch and repeat step 2:
  k$ git show HEAD~1 -- Koha/ILL/ISO18626.pm | git apply -R
  k$ prove -v t/db_dependent/Koha/ILL/ISO18626.t
=> FAIL: The messages do not validate (elements out of schema order)
4. Restore the fix:
  k$ git checkout Koha/ILL/ISO18626.pm
5. Sign off :-D

Assisted-by: Opus 5.5 (Anthropic)
Signed-off-by: Tomás Cohen Arazi <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to