Bugzilla – Attachment 113593 Details for
Bug 27012
Merging records with holds causes SQL error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27012: Add test for C4::Reserves::MergeHolds
Bug-27012-Add-test-for-C4ReservesMergeHolds.patch (text/plain), 1.99 KB, created by
Joonas Kylmälä
on 2020-11-13 11:51:29 UTC
(
hide
)
Description:
Bug 27012: Add test for C4::Reserves::MergeHolds
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2020-11-13 11:51:29 UTC
Size:
1.99 KB
patch
obsolete
>From a08b75cb08784ee3bab6519e49f484f2f5647229 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@helsinki.fi> >Date: Fri, 13 Nov 2020 13:41:16 +0200 >Subject: [PATCH] Bug 27012: Add test for C4::Reserves::MergeHolds > >This does a basic check whether a hold gets moved to another biblio >when MergeHolds() is called. >--- > t/db_dependent/Reserves.t | 29 ++++++++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 6ddb3f4f56..4faab3c218 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 65; >+use Test::More tests => 66; > use Test::MockModule; > use Test::Warn; > >@@ -1190,6 +1190,33 @@ subtest 'AllowHoldOnPatronPossession test' => sub { > 'Patron can place hold on an item loaned to itself'); > }; > >+subtest 'MergeHolds' => sub { >+ >+ plan tests => 1; >+ >+ my $biblio_1 = $builder->build_sample_biblio(); >+ my $biblio_2 = $builder->build_sample_biblio(); >+ my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >+ my $itype = $builder->build_object( >+ { class => "Koha::ItemTypes", value => { notforloan => 0 } } ); >+ my $item_1 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio_1->biblionumber, >+ itype => $itype->itemtype, >+ library => $library->branchcode >+ } >+ ); >+ my $patron_1 = $builder->build_object( { class => "Koha::Patrons" } ); >+ >+ # Place a hold on $biblio_1 >+ my $priority = 1; >+ place_item_hold( $patron_1, $item_1, $library, $priority ); >+ >+ # Move and make sure hold is now on $biblio_2 >+ C4::Reserves::MergeHolds($dbh, $biblio_2->biblionumber, $biblio_1->biblionumber); >+ is( $biblio_2->holds->count, 1, 'Hold has been transferred' ); >+}; >+ > sub count_hold_print_messages { > my $message_count = $dbh->selectall_arrayref(q{ > SELECT COUNT(*) >-- >2.11.0
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 27012
:
113592
|
113593
|
113594
|
113632
|
113633
|
113651
|
113652