From e8a8f013709c711d1b38e140ec2666bce2e7cce7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 6 Jul 2020 13:46:15 +0100 Subject: [PATCH] Bug 21468: Unit tests for AddReturn Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Plugins/Circulation_hooks.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Plugins/Circulation_hooks.t b/t/db_dependent/Koha/Plugins/Circulation_hooks.t index a081af1152..97bee3d346 100755 --- a/t/db_dependent/Koha/Plugins/Circulation_hooks.t +++ b/t/db_dependent/Koha/Plugins/Circulation_hooks.t @@ -44,7 +44,7 @@ t::lib::Mocks::mock_config( 'enable_plugins', 1 ); subtest 'after_circ_action() hook tests' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -88,6 +88,17 @@ subtest 'after_circ_action() hook tests' => sub { 'AddRenewal calls the after_circ_action hook'; }; + subtest 'AddReturn' => sub { + plan tests => 1; + + warning_like { + AddReturn( $patron->borrowernumber, $item->id, + $patron->branchcode ); + } + qr/after_circ_action called with action: checkin, ref: DateTime/, + 'AddReturn calls the after_circ_action hook'; + }; + $schema->storage->txn_rollback; Koha::Plugins::Methods->delete; }; -- 2.27.0