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

--- Comment #45 from David Nind <[email protected]> ---
Created attachment 198682
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198682&action=edit
Bug 42418: (follow-up) Fix tests using invalid mock_userenv

The checkins table has a FK on user_id pointing to borrowers.
Several mock_userenv calls only passed branchcode, which defaults
borrowernumber to the hardcoded value 51 — a non-existent patron.
This causes FK violations when AddReturn creates a checkin record.

This patch fixes the affected calls in Circulation.t and Branch.t
by passing a valid patron to mock_userenv. It also adjusts the
stock rotation transfer test to account for the new 5th return
value from AddReturn (the Koha::Checkin object), and adds tests
for the three checkin record user_id scenarios (valid patron,
missing number, explicit undef number).

A global fix to mock_userenv (auto-generating a patron when none
is passed) would address the ~120 remaining calls across the test
suite, but the risk surface warrants a separate bug.

Signed-off-by: David Nind <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to