Bug 33262: Unit tests

prove t/db_dependent/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2023-05-04 13:08:54 +00:00 committed by Tomas Cohen Arazi
parent c8faeac4cd
commit 177b53d794
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -653,7 +653,7 @@ subtest 'deletedbiblio_metadata' => sub {
subtest 'DelBiblio' => sub { subtest 'DelBiblio' => sub {
plan tests => 5; plan tests => 6;
t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); 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 C4::Biblio::DelBiblio($biblio->biblionumber); # Or $biblio->delete
is( $subscription->get_from_storage, undef, 'subscription should be deleted on biblio deletion' ); 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( $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( $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 { subtest 'MarcFieldForCreatorAndModifier' => sub {