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-"); |