Bug 21817: Centralize the mock of userenv from tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Nov 2018 21:21:58 +0000 (18:21 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 7 Jan 2019 14:49:50 +0000 (14:49 +0000)
commit336fedc15dc1ec0e826388abaa317ceaaac16614
tree01cc13aeacbab6c0ead1ab5b844d7210a07a5863
parent1d9b0fa57efd9a7215b38e5f5b7d30fba788caa6
Bug 21817: Centralize the mock of userenv from tests

This patch adds a new method mock_userenv from t::lib::Mocks in order to
simplify the mock of the userenv.

Test plan:
prove all the test files modified by this patch

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit ca124b5c14a3f0a34fafe307fec9ade4008eaa41)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
37 files changed:
t/Budgets/CanUserModifyBudget.t
t/Budgets/CanUserUseBudget.t
t/Circulation_barcodedecode.t
t/db_dependent/Acquisition/NewOrder.t
t/db_dependent/ArticleRequests.t
t/db_dependent/Bookseller.t
t/db_dependent/Budgets.t
t/db_dependent/Circulation.t
t/db_dependent/Circulation/IsItemIssued.t
t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t
t/db_dependent/Circulation/MarkIssueReturned.t
t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
t/db_dependent/Circulation/TooMany.t
t/db_dependent/Circulation/issue.t
t/db_dependent/DecreaseLoanHighHolds.t
t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t
t/db_dependent/Holds/RevertWaitingStatus.t
t/db_dependent/Koha/Items.t
t/db_dependent/Koha/Object.t
t/db_dependent/Koha/Patron/Modifications.t
t/db_dependent/Koha/Patrons.t
t/db_dependent/Koha/Reviews.t
t/db_dependent/Labels/t_Label.t
t/db_dependent/Letters.t
t/db_dependent/Letters/TemplateToolkit.t
t/db_dependent/MarcModificationTemplates.t
t/db_dependent/Members.t
t/db_dependent/Members/Attributes.t
t/db_dependent/Patron/Borrower_Discharge.t
t/db_dependent/Patron/Borrower_PrevCheckout.t
t/db_dependent/PatronLists.t
t/db_dependent/Reserves.t
t/db_dependent/Template/Plugin/Branches.t
t/db_dependent/Utils/Datatables_Members.t
t/db_dependent/Utils/Datatables_Virtualshelves.t
t/db_dependent/rollingloans.t
t/lib/Mocks.pm