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

(-)a/t/db_dependent/Koha/Biblio/Metadata.t (-2 / +16 lines)
Lines 86-92 subtest 'record() tests' => sub { Link Here
86
};
86
};
87
87
88
subtest '_embed_items' => sub {
88
subtest '_embed_items' => sub {
89
    plan tests => 8;
89
    plan tests => 10;
90
90
91
    $schema->storage->txn_begin();
91
    $schema->storage->txn_begin();
92
92
Lines 190-194 subtest '_embed_items' => sub { Link Here
190
'For OPAC, If all items are hidden, no item should have been embedded'
190
'For OPAC, If all items are hidden, no item should have been embedded'
191
    );
191
    );
192
192
193
    # Check position of 952 in response of embed_items marc
194
    t::lib::Mocks::mock_preference( 'OpacHiddenItems', q{} );
195
    $record = $biblio->metadata->record;
196
    $record->insert_fields_ordered(
197
        MARC::Field->new( '951', '', '', a => 'before items' ),
198
        MARC::Field->new( '953', '', '', a => 'after  items' ),
199
    );
200
    C4::Biblio::ModBiblio( $record, $biblio->biblionumber, q{} );
201
    my $field_list = join ',', map { $_->tag } $record->fields;
202
    ok( $field_list =~ /951,953/, "951 and 953 in $field_list" );
203
    $biblio->discard_changes;
204
    $record = $biblio->metadata->record({ embed_items => 1 });
205
    $field_list = join ',', map { $_->tag } $record->fields;
206
    ok( $field_list =~ /951,(952,)+953/, "951-952s-953 in $field_list" );
207
193
    $schema->storage->txn_rollback;
208
    $schema->storage->txn_rollback;
194
};
209
};
195
- 

Return to bug 31889