From 1920fcf9dd32559cf812416ac3f4fb0b78b57c75 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Thu, 4 Sep 2025 17:58:31 +0000 Subject: [PATCH] Bug 39419: (follow-up) Unit tests perl t/db_dependent/Reserves.t --- t/db_dependent/Reserves.t | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 79d6796f82..ef0fec81b3 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -1507,7 +1507,7 @@ subtest 'IsAvailableForItemLevelRequest() tests' => sub { subtest 'AddReserve() tests' => sub { - plan tests => 2; + plan tests => 4; $schema->storage->txn_begin; @@ -1553,6 +1553,31 @@ subtest 'AddReserve() tests' => sub { $patron->discard_changes; isnt( $patron->lastseen, undef, "Patron activity tracked when hold is a valid trigger" ); + my $reserve_id = AddReserve( + { + branchcode => $library->branchcode, + borrowernumber => $patron->id, + biblionumber => $biblio->id, + expiration_date => '2040-04-02' + } + ); + + my $hold = Koha::Holds->find($reserve_id); + + is( $hold->expirationdate, '2040-04-02', 'Successfully set expiration date' ); + + $reserve_id = AddReserve( + { + branchcode => $library->branchcode, + borrowernumber => $patron->id, + biblionumber => $biblio->id, + patron_expiration_date => '2040-04-02' + } + ); + + $hold = Koha::Holds->find($reserve_id); + is( $hold->patron_expiration_date, '2040-04-02', 'Successfully set patron expiration date' ); + $schema->storage->txn_rollback; }; -- 2.39.5