From b40ba2d7b41b2d0e3bf6f805afcf2bd5690e67f8 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 --- 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 9254f5395a..031da43f7a 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; @@ -91,6 +91,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.20.1