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

(-)a/t/db_dependent/Authorities/Merge.t (-2 / +22 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 Getopt::Long;
9
use Getopt::Long;
10
use MARC::Record;
10
use MARC::Record;
Lines 216-221 subtest 'Test merge A1 to B1 (changing authtype)' => sub { Link Here
216
        'Check 612x' );
216
        'Check 612x' );
217
};
217
};
218
218
219
subtest 'Merging authorities should handle deletes (BZ 14026)' => sub {
220
    plan tests => 1;
221
222
    # Add authority and linked biblio, delete authority
223
    my $auth1 = MARC::Record->new;
224
    $auth1->append_fields( MARC::Field->new( '109', '', '', 'a' => 'DEL'));
225
    my $authid1 = AddAuthority( $auth1, undef, $authtype1 );
226
    my $bib1 = MARC::Record->new;
227
    $bib1->append_fields(
228
        MARC::Field->new( '245', '', '', a => 'test DEL' ),
229
        MARC::Field->new( '609', '', '', a => 'DEL', 9 => "$authid1" ),
230
    );
231
    my ( $biblionumber ) = C4::Biblio::AddBiblio( $bib1, '' );
232
    DelAuthority( $authid1 );
233
234
    # See what happened
235
    my $marc1 = C4::Biblio::GetMarcBiblio( $biblionumber );
236
    is( $marc1->field('609') && $marc1->field('609')->subfield('9'),
237
        $authid1, 'FIXME: Merge should be called to remove this subfield' );
238
};
239
219
sub set_mocks {
240
sub set_mocks {
220
    # Mock ZOOM objects: They do nothing actually
241
    # Mock ZOOM objects: They do nothing actually
221
    # Get new_record_from_zebra to return the records
242
    # Get new_record_from_zebra to return the records
222
- 

Return to bug 14026