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

(-)a/t/db_dependent/Koha/Item.t (-5 / +5 lines)
Lines 1115-1121 subtest 'columns_to_str' => sub { Link Here
1115
1115
1116
    my $biblio = $builder->build_sample_biblio({ frameworkcode => '' });
1116
    my $biblio = $builder->build_sample_biblio({ frameworkcode => '' });
1117
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1117
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1118
    my $itemlost = Koha::AuthorisedValues->search({ category => 'LOST' })->next->authorised_value;
1118
    my $lost_av = $builder->build_object({ class => 'Koha::AuthorisedValues', value => { category => 'LOST', authorised_value => '42' }});
1119
    my $dateaccessioned = '2020-12-15';
1119
    my $dateaccessioned = '2020-12-15';
1120
    my $library = Koha::Libraries->search->next;
1120
    my $library = Koha::Libraries->search->next;
1121
    my $branchcode = $library->branchcode;
1121
    my $branchcode = $library->branchcode;
Lines 1138-1144 subtest 'columns_to_str' => sub { Link Here
1138
1138
1139
    $item->update(
1139
    $item->update(
1140
        {
1140
        {
1141
            itemlost           => $itemlost,
1141
            itemlost           => $lost_av->authorised_value,
1142
            dateaccessioned    => $dateaccessioned,
1142
            dateaccessioned    => $dateaccessioned,
1143
            more_subfields_xml => $some_marc_xml,
1143
            more_subfields_xml => $some_marc_xml,
1144
        }
1144
        }
Lines 1147-1155 subtest 'columns_to_str' => sub { Link Here
1147
    $item = $item->get_from_storage;
1147
    $item = $item->get_from_storage;
1148
1148
1149
    my $s = $item->columns_to_str;
1149
    my $s = $item->columns_to_str;
1150
    is( $s->{itemlost}, 'Lost' );
1150
    is( $s->{itemlost}, $lost_av->lib, 'Attributes linked with AV replaced with description' );
1151
    is( $s->{dateaccessioned}, '2020-12-15');
1151
    is( $s->{dateaccessioned}, '2020-12-15', 'Date attributes iso formatted');
1152
    is( $s->{é}, 'value é');
1152
    is( $s->{é}, 'value é', 'subfield ok with more than a-Z');
1153
    is( $s->{è}, $library->branchname );
1153
    is( $s->{è}, $library->branchname );
1154
1154
1155
    $cache->clear_from_cache("MarcStructure-0-");
1155
    $cache->clear_from_cache("MarcStructure-0-");
(-)a/t/db_dependent/Koha/UI/Form/Builder/Item.t (-2 / +1 lines)
Lines 96-102 subtest 'authorised values' => sub { Link Here
96
    subtest 'branches' => sub {
96
    subtest 'branches' => sub {
97
        plan tests => 2;
97
        plan tests => 2;
98
        my ( $subfield ) = grep { $_->{kohafield} eq 'items.homebranch' } @$subfields;
98
        my ( $subfield ) = grep { $_->{kohafield} eq 'items.homebranch' } @$subfields;
99
        my $libraries = Koha::Libraries->search;
99
        my $libraries = Koha::Libraries->search({}, { order_by => 'branchname' });
100
        is_deeply(
100
        is_deeply(
101
            $subfield->{marc_value}->{values},
101
            $subfield->{marc_value}->{values},
102
            [ $libraries->get_column('branchcode') ]
102
            [ $libraries->get_column('branchcode') ]
103
- 

Return to bug 28445