View | Details | Raw Unified | Return to bug 18070
Collapse All | Expand All

(-)a/t/db_dependent/Authorities/Merge.t (-2 / +21 lines)
Lines 4-10 Link Here
4
4
5
use Modern::Perl;
5
use Modern::Perl;
6
6
7
use Test::More tests => 4;
7
use Test::More tests => 5;
8
8
9
use MARC::Record;
9
use MARC::Record;
10
use Test::MockModule;
10
use Test::MockModule;
Lines 224-229 subtest 'Test merge A1 to B1 (changing authtype)' => sub { Link Here
224
        'Check 612x' );
224
        'Check 612x' );
225
};
225
};
226
226
227
subtest 'Merging authorities should handle deletes (BZ 18070)' => sub {
228
    plan tests => 1;
229
230
    # Add authority and linked biblio, delete authority
231
    my $auth1 = MARC::Record->new;
232
    $auth1->append_fields( MARC::Field->new( '109', '', '', 'a' => 'DEL'));
233
    my $authid1 = AddAuthority( $auth1, undef, $authtype1 );
234
    my $bib1 = MARC::Record->new;
235
    $bib1->append_fields(
236
        MARC::Field->new( '245', '', '', a => 'test DEL' ),
237
        MARC::Field->new( '609', '', '', a => 'DEL', 9 => "$authid1" ),
238
    );
239
    my ( $biblionumber ) = C4::Biblio::AddBiblio( $bib1, '' );
240
    DelAuthority( $authid1 );
241
242
    # See what happened
243
    my $marc1 = C4::Biblio::GetMarcBiblio( $biblionumber );
244
    is( $marc1->field('609'), undef, 'Field 609 should be gone too' );
245
};
246
227
sub set_mocks {
247
sub set_mocks {
228
    # Mock ZOOM objects: They do nothing actually
248
    # Mock ZOOM objects: They do nothing actually
229
    # Get new_record_from_zebra to return the records
249
    # Get new_record_from_zebra to return the records
230
- 

Return to bug 18070