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

(-)a/t/db_dependent/Koha/Item.t (-6 / +5 lines)
Lines 1103-1109 subtest 'columns_to_str' => sub { Link Here
1103
1103
1104
    my $biblio = $builder->build_sample_biblio({ frameworkcode => '' });
1104
    my $biblio = $builder->build_sample_biblio({ frameworkcode => '' });
1105
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1105
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1106
    my $itemlost = Koha::AuthorisedValues->search({ category => 'LOST' })->next->authorised_value;
1106
    my $lost_av = $builder->build_object({ class => 'Koha::AuthorisedValues', value => { category => 'LOST', authorised_value => '42' }});
1107
    my $dateaccessioned = '2020-12-15';
1107
    my $dateaccessioned = '2020-12-15';
1108
    my $library = Koha::Libraries->search->next;
1108
    my $library = Koha::Libraries->search->next;
1109
    my $branchcode = $library->branchcode;
1109
    my $branchcode = $library->branchcode;
Lines 1126-1132 subtest 'columns_to_str' => sub { Link Here
1126
1126
1127
    $item->update(
1127
    $item->update(
1128
        {
1128
        {
1129
            itemlost           => $itemlost,
1129
            itemlost           => $lost_av->authorised_value,
1130
            dateaccessioned    => $dateaccessioned,
1130
            dateaccessioned    => $dateaccessioned,
1131
            more_subfields_xml => $some_marc_xml,
1131
            more_subfields_xml => $some_marc_xml,
1132
        }
1132
        }
Lines 1135-1143 subtest 'columns_to_str' => sub { Link Here
1135
    $item = $item->get_from_storage;
1135
    $item = $item->get_from_storage;
1136
1136
1137
    my $s = $item->columns_to_str;
1137
    my $s = $item->columns_to_str;
1138
    is( $s->{itemlost}, 'Lost' );
1138
    is( $s->{itemlost}, $lost_av->lib, 'Attributes linked with AV replaced with description' );
1139
    is( $s->{dateaccessioned}, '2020-12-15');
1139
    is( $s->{dateaccessioned}, '2020-12-15', 'Date attributes iso formatted');
1140
    is( $s->{'é'}, 'value é');
1140
    is( $s->{'é'}, 'value é', 'subfield ok with more than a-Z');
1141
    is( $s->{'è'}, $library->branchname );
1141
    is( $s->{'è'}, $library->branchname );
1142
1142
1143
    $cache->clear_from_cache("MarcStructure-0-");
1143
    $cache->clear_from_cache("MarcStructure-0-");
1144
- 

Return to bug 27526