From 3007bed0c00cda0ad3760003324dcb829d0f83a9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 31 Mar 2023 14:11:46 +0200 Subject: [PATCH] Bug 32548: Add tests --- t/db_dependent/Illrequests.t | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t index 65c1bc6fa5d..179333d24a3 100755 --- a/t/db_dependent/Illrequests.t +++ b/t/db_dependent/Illrequests.t @@ -1102,6 +1102,24 @@ subtest 'Helpers' => sub { }); is($queue->count, 1, "Notice is not queued"); + my $attribute = $builder->build({ + source => 'Illrequestattribute', + value => { illrequest_id => $illrq_obj->illrequest_id, type => 'pages', value => '42' } + }); + + my $ILL_REQUEST_CANCEL_content = + q{The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request: + +[% ill_full_metadata %] + +Attribute: Pages=[% illrequestattributes.pages %] +}; + my $dbh = C4::Context->dbh; + $dbh->do(q{UPDATE letter + SET content=? + WHERE code="ILL_REQUEST_CANCEL" + }, undef, $ILL_REQUEST_CANCEL_content); + #get_notice my $not = $illrq_obj->get_notice({ notice_code => 'ILL_REQUEST_CANCEL', @@ -1130,7 +1148,7 @@ subtest 'Helpers' => sub { $not->{content} =~ s/\s//g; is( - $not->{content},"Thepatronforinterlibraryloansrequest" . $illrq_obj->id . ",withthefollowingdetails,hasrequestedcancellationofthisILLrequest:-author:myauthor-title:mytitle", + $not->{content},"Thepatronforinterlibraryloansrequest" . $illrq_obj->id . ",withthefollowingdetails,hasrequestedcancellationofthisILLrequest:-author:myauthor-title:mytitleAttribute:Pages=42", 'Correct content returned from get_notice with metadata correctly ordered' ); -- 2.25.1