Bugzilla – Attachment 185371 Details for
Bug 37651
biblio->current_holds and item->current_holds do not respect ConfirmFutureHolds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37651: (follow-up) Add GetAvailability test case for future hold
Bug-37651-follow-up-Add-GetAvailability-test-case-.patch (text/plain), 3.18 KB, created by
Nick Clemens (kidclamp)
on 2025-08-13 14:11:14 UTC
(
hide
)
Description:
Bug 37651: (follow-up) Add GetAvailability test case for future hold
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2025-08-13 14:11:14 UTC
Size:
3.18 KB
patch
obsolete
>From 36ff6d223797b4577f784b6ab284795d5f78f030 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 21 Jul 2025 16:02:49 +0200 >Subject: [PATCH] Bug 37651: (follow-up) Add GetAvailability test case for > future hold > >Test plan: >Run t/db_dependent/ILSDI_Services.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/ILSDI_Services.t | 47 ++++++++++++++++++++++++++++++++- > 1 file changed, 46 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t >index e439df02baa..0a75e7dd748 100755 >--- a/t/db_dependent/ILSDI_Services.t >+++ b/t/db_dependent/ILSDI_Services.t >@@ -20,7 +20,7 @@ use Modern::Perl; > use CGI qw ( -utf8 ); > > use Test::NoWarnings; >-use Test::More tests => 15; >+use Test::More tests => 16; > use Test::MockModule; > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -1147,6 +1147,51 @@ subtest 'GetAvailability itemcallnumber' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'GetAvailability availabilitystatus' => sub { >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ my $item = $builder->build_sample_item; >+ >+ my ( $cgi, $reply, $xml, $status, $message ); >+ $cgi = CGI->new; >+ $cgi->param( service => 'GetAvailability' ); >+ $cgi->param( id => $item->biblionumber ); >+ $cgi->param( id_type => 'biblio' ); >+ $reply = C4::ILSDI::Services::GetAvailability($cgi); >+ $xml = XML::LibXML->load_xml( string => $reply ); >+ $status = $xml->findnodes('//dlf:availabilitystatus')->to_literal(); >+ is( $status, 'available', 'GetAvailability returns available' ); >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ $patron->branchcode( $item->holdingbranch )->store; >+ AddReserve( >+ { >+ reservation_date => dt_from_string()->add( days => 1 ), >+ branchcode => $item->holdingbranch, >+ borrowernumber => $patron->id, >+ biblionumber => $item->biblionumber, >+ itemnumber => $item->itemnumber, >+ } >+ ); >+ t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 0 ); >+ $reply = C4::ILSDI::Services::GetAvailability($cgi); >+ $xml = XML::LibXML->load_xml( string => $reply ); >+ $status = $xml->findnodes('//dlf:availabilitystatus')->to_literal(); >+ is( $status, 'available', 'GetAvailability returns available, ignoring future hold' ); >+ >+ t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 2 ); >+ $reply = C4::ILSDI::Services::GetAvailability($cgi); >+ $xml = XML::LibXML->load_xml( string => $reply ); >+ $status = $xml->findnodes('//dlf:availabilitystatus')->to_literal(); >+ $message = $xml->findnodes('//dlf:availabilitymsg')->to_literal(); >+ is( $status, 'not available', 'GetAvailability returns not available status for future hold' ); >+ is( $message, 'On hold', 'GetAvailability returns on hold message for future hold' ); >+ >+ t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 0 ); >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron' => sub { > > plan tests => 2; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37651
:
171247
|
171248
|
171249
|
171250
|
176654
|
176655
|
176656
|
176808
|
176809
|
176810
|
176811
|
177372
|
178325
|
178326
|
178327
|
178328
|
178329
|
184438
|
184439
|
184440
|
184441
|
184442
|
184443
|
184444
|
185365
|
185366
|
185367
|
185368
|
185369
|
185370
| 185371 |
185706