Koha-clms/t/db_dependent/Koha/Auth
Martin Renvoize 255eeaf4f6
Bug 43375: (QA follow-up) Add test coverage for form-data fallback in userinfo parsing
_get_data_and_patron() falls back to Mojo::Parameters form-data
parsing whenever $tx->res->json fails to decode the userinfo
response body. That branch was untested: all existing userinfo_url
subtests mock json() to return a hashref, so the fallback path was
never actually exercised.

This adds a subtest that mocks a genuine url-encoded response body
(json() returning undef) and confirms the fallback still maps data
and finds the matching patron correctly.

Test plan:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Auth/Client/OAuth.t
=> SUCCESS: All 6 subtests pass, including the new fallback-path test
2. Sign off

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-21 11:11:28 +00:00
..
Client Bug 43375: (QA follow-up) Add test coverage for form-data fallback in userinfo parsing 2026-09-21 11:11:28 +00:00
Identity Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
Client.t Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
TwoFactorAuth.t Bug 40444: Add a test to ensure all Perl test files use Test::NoWarnings 2025-07-28 16:26:36 -06:00