From ff297226e7b892b53c8c0a264737b2a55ac76be8 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 20 Feb 2025 11:38:28 +0000 Subject: [PATCH] Bug 32630: Add tests prove t/db_dependent/Koha/ILL/Requests.t Sponsored-by: UKHSA - UK Health Security Agency Signed-off-by: Jeremy Evans Signed-off-by: Lisette Scheer --- t/db_dependent/Koha/ILL/Requests.t | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/ILL/Requests.t b/t/db_dependent/Koha/ILL/Requests.t index c5ba6262cbc..d647679c2ee 100755 --- a/t/db_dependent/Koha/ILL/Requests.t +++ b/t/db_dependent/Koha/ILL/Requests.t @@ -1065,7 +1065,7 @@ subtest 'Backend core methods' => sub { subtest 'Helpers' => sub { - plan tests => 25; + plan tests => 26; $schema->storage->txn_begin; @@ -1341,6 +1341,29 @@ Attribute: Pages=[% illrequestattributes.pages %] 'appending to a note works' ); + my $illrq_without_patron = $builder->build( + { + source => 'Illrequest', + value => { branchcode => "HDE", borrowernumber => undef } + } + ); + my $illrq_obj_without_patron = Koha::ILL::Requests->find( $illrq_without_patron->{illrequest_id} ); + $illrq_obj_without_patron->_config($config); + $illrq_obj_without_patron->_backend($backend); + + my $get_notice_without_patron = $illrq_obj_without_patron->get_notice( + { + notice_code => 'ILL_REQUEST_CANCEL', + transport => 'email' + } + ); + + is( + $get_notice_without_patron->{lang}, + "default", + 'Koha::ILL::Request->get_notice lang correctly defaults to "default" for a request without a patron' + ); + $schema->storage->txn_rollback; }; -- 2.39.5