Bugzilla – Attachment 173343 Details for
Bug 30648
Title is lost in holds history when bibliographic record is deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30648: Unit tests
Bug-30648-Unit-tests.patch (text/plain), 2.84 KB, created by
Biblibre Sandboxes
on 2024-10-25 10:55:07 UTC
(
hide
)
Description:
Bug 30648: Unit tests
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2024-10-25 10:55:07 UTC
Size:
2.84 KB
patch
obsolete
>From cb87a97529d897756e5578700d78a2df45e38cc5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 11 Oct 2024 12:49:23 +0000 >Subject: [PATCH] Bug 30648: Unit tests >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Anneli Ãsterman <anneli.osterman@koha-suomi.fi> >--- > t/db_dependent/Biblio.t | 33 ++++++++++++++++++++++++++++++++- > t/lib/TestBuilder.pm | 6 ++++++ > 2 files changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t >index d2d5a5bbff..35df97fd0b 100755 >--- a/t/db_dependent/Biblio.t >+++ b/t/db_dependent/Biblio.t >@@ -676,10 +676,41 @@ subtest 'deletedbiblio_metadata' => sub { > > subtest 'DelBiblio' => sub { > >- plan tests => 10; >+ plan tests => 11; > > t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); > >+ subtest 'DelBiblio holds handling' => sub { >+ >+ plan tests => 3; >+ my $biblio = $builder->build_sample_biblio; >+ my $hold = $builder->build_object( >+ { >+ class => 'Koha::Holds', >+ value => { biblionumber => $biblio->biblionumber } >+ } >+ ); >+ my $old_hold = $builder->build_object( >+ { >+ class => 'Koha::Old::Holds', >+ value => { biblionumber => $biblio->biblionumber } >+ } >+ ); >+ >+ C4::Biblio::DelBiblio($biblio->biblionumber); >+ $old_hold->discard_changes(); >+ $hold = Koha::Old::Holds->find( $hold->reserve_id ); >+ ok( $hold, "Hold has been successfully cancelled on deletion of biblio" ); >+ is( >+ $old_hold->deleted_biblionumber, $biblio->biblionumber, >+ "Biblionumber has been successfully recorded during deletion for old holds" >+ ); >+ is( >+ $hold->deleted_biblionumber, $biblio->biblionumber, >+ "Biblionumber has been successfully recorded during deletion for existing hold that was cancelled" >+ ); >+ }; >+ > my ($biblionumber, $biblioitemnumber) = C4::Biblio::AddBiblio(MARC::Record->new, ''); > my $deleted = C4::Biblio::DelBiblio( $biblionumber ); > is( $deleted, undef, 'DelBiblio returns undef is the biblio has been deleted correctly - Must be 1 instead'); # FIXME We should return 1 instead! >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index 57506b11d7..63cfe5d049 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -630,6 +630,12 @@ sub _gen_default_values { > Reserve => { > non_priority => 0, > item_group_id => undef, >+ deleted_biblionumber => undef, >+ }, >+ OldReserve => { >+ non_priority => 0, >+ item_group_id => undef, >+ deleted_biblionumber => undef, > }, > Itemtype => { > rentalcharge => 0, >-- >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 30648
:
172687
|
172688
|
172689
|
172690
|
172691
|
172692
|
173340
|
173341
|
173342
|
173343
|
173344
|
173345
|
173491
|
173492
|
173493
|
173494
|
173495
|
173496
|
173611