Lines 670-676
subtest 'deletedbiblio_metadata' => sub {
Link Here
|
670 |
|
670 |
|
671 |
subtest 'DelBiblio' => sub { |
671 |
subtest 'DelBiblio' => sub { |
672 |
|
672 |
|
673 |
plan tests => 6; |
673 |
plan tests => 10; |
674 |
|
674 |
|
675 |
t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); |
675 |
t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); |
676 |
|
676 |
|
Lines 716-726
subtest 'DelBiblio' => sub {
Link Here
|
716 |
my $order = $builder->build_object( |
716 |
my $order = $builder->build_object( |
717 |
{ class => 'Koha::Acquisition::Orders', value => $orderinfo } ); |
717 |
{ class => 'Koha::Acquisition::Orders', value => $orderinfo } ); |
718 |
|
718 |
|
|
|
719 |
# Add some ILL requests |
720 |
my $ill_req_1 = $builder->build_object({ class => 'Koha::Illrequests', value => { biblio_id => $biblio->id, deleted_biblio_id => undef } }); |
721 |
my $ill_req_2 = $builder->build_object({ class => 'Koha::Illrequests', value => { biblio_id => $biblio->id, deleted_biblio_id => undef } }); |
722 |
|
719 |
C4::Biblio::DelBiblio($biblio->biblionumber); # Or $biblio->delete |
723 |
C4::Biblio::DelBiblio($biblio->biblionumber); # Or $biblio->delete |
720 |
is( $subscription->get_from_storage, undef, 'subscription should be deleted on biblio deletion' ); |
724 |
is( $subscription->get_from_storage, undef, 'subscription should be deleted on biblio deletion' ); |
721 |
is( $serial->get_from_storage, undef, 'serial should be deleted on biblio deletion' ); |
725 |
is( $serial->get_from_storage, undef, 'serial should be deleted on biblio deletion' ); |
722 |
is( $subscription_history->get_from_storage, undef, 'subscription history should be deleted on biblio deletion' ); |
726 |
is( $subscription_history->get_from_storage, undef, 'subscription history should be deleted on biblio deletion' ); |
723 |
is( $order->get_from_storage->deleted_biblionumber, $biblio->biblionumber, 'biblionumber of order has been moved to deleted_biblionumber column' ); |
727 |
is( $order->get_from_storage->deleted_biblionumber, $biblio->biblionumber, 'biblionumber of order has been moved to deleted_biblionumber column' ); |
|
|
728 |
|
729 |
$ill_req_1 = $ill_req_1->get_from_storage; |
730 |
$ill_req_2 = $ill_req_2->get_from_storage; |
731 |
is( $ill_req_1->biblio_id, undef, 'biblio_id cleared on biblio deletion' ); |
732 |
is( $ill_req_1->deleted_biblio_id, $biblio->id, 'biblio_id is kept on the deleted_biblio_id column' ); |
733 |
is( $ill_req_2->biblio_id, undef, 'biblio_id cleared on biblio deletion' ); |
734 |
is( $ill_req_2->deleted_biblio_id, $biblio->id, 'biblio_id is kept on the deleted_biblio_id column' ); |
724 |
}; |
735 |
}; |
725 |
|
736 |
|
726 |
subtest 'MarcFieldForCreatorAndModifier' => sub { |
737 |
subtest 'MarcFieldForCreatorAndModifier' => sub { |
727 |
- |
|
|