From 0393344d844ed343431016662c3db506e738c7b0 Mon Sep 17 00:00:00 2001
From: Katrin Fischer <katrin.fischer@bsz-bw.de>
Date: Thu, 4 May 2023 13:08:54 +0000
Subject: [PATCH] Bug 33262: Unit tests

prove t/db_dependent/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
---
 t/db_dependent/Biblio.t | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t
index ab8c2f6d43..10df3a8856 100755
--- a/t/db_dependent/Biblio.t
+++ b/t/db_dependent/Biblio.t
@@ -653,7 +653,7 @@ subtest 'deletedbiblio_metadata' => sub {
 
 subtest 'DelBiblio' => sub {
 
-    plan tests => 5;
+    plan tests => 6;
 
     t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 );
 
@@ -689,10 +689,21 @@ subtest 'DelBiblio' => sub {
             }
         }
     );
+
+    my $order_basket = $builder->build( { source => 'Aqbasket' } );
+
+    my $orderinfo = {
+        biblionumber => $biblio->biblionumber,
+        basketno     => $order_basket->{basketno},
+    };
+    my $order = $builder->build_object(
+        { class => 'Koha::Acquisition::Orders', value => $orderinfo } );
+
     C4::Biblio::DelBiblio($biblio->biblionumber); # Or $biblio->delete
     is( $subscription->get_from_storage, undef, 'subscription should be deleted on biblio deletion' );
     is( $serial->get_from_storage, undef, 'serial should be deleted on biblio deletion' );
     is( $subscription_history->get_from_storage, undef, 'subscription history should be deleted on biblio deletion' );
+    is( $order->get_from_storage->deleted_biblionumber, $biblio->biblionumber, 'biblionumber of order has been moved to deleted_biblionumber column' );
 };
 
 subtest 'MarcFieldForCreatorAndModifier' => sub {
-- 
2.30.2