|
Lines 228-235
subtest 'search_by_*_field + find_by_koha_field + get_description + authorised_v
Link Here
|
| 228 |
|
228 |
|
| 229 |
}; |
229 |
}; |
| 230 |
subtest 'find_by_koha_field' => sub { |
230 |
subtest 'find_by_koha_field' => sub { |
| 231 |
plan tests => 3; |
231 |
plan tests => 4; |
| 232 |
|
|
|
| 233 |
# Test authorised_value = 0 |
232 |
# Test authorised_value = 0 |
| 234 |
my $av; |
233 |
my $av; |
| 235 |
$av = Koha::AuthorisedValues->find_by_koha_field( { kohafield => 'items.restricted', authorised_value => 0 } ); |
234 |
$av = Koha::AuthorisedValues->find_by_koha_field( { kohafield => 'items.restricted', authorised_value => 0 } ); |
|
Lines 243-248
subtest 'search_by_*_field + find_by_koha_field + get_description + authorised_v
Link Here
|
| 243 |
$av = Koha::AuthorisedValues->find_by_koha_field( |
242 |
$av = Koha::AuthorisedValues->find_by_koha_field( |
| 244 |
{ kohafield => 'items.restricted', authorised_value => undef } ); |
243 |
{ kohafield => 'items.restricted', authorised_value => undef } ); |
| 245 |
is( $av, undef, ); |
244 |
is( $av, undef, ); |
|
|
245 |
# Test get authorised_value->opac_description if kohafield is in array |
| 246 |
my @authorised_kohafields = ( 'location', 'ccode', 'permanent_location', 'notforloan', 'itemlost', 'withdrawn', 'damaged', 'restricted' ); |
| 247 |
foreach my $kohafield (@authorised_kohafields) { |
| 248 |
$av = Koha::AuthorisedValues->find_by_koha_field( { kohafield => 'items.' . $kohafield, authorised_value => 'location_1' } ); |
| 249 |
if ($av) { |
| 250 |
is( |
| 251 |
$av->opac_description, 'location_1', "items.$kohafield description added correctly" ); |
| 252 |
} |
| 253 |
} |
| 246 |
}; |
254 |
}; |
| 247 |
subtest 'get_description_by_koha_field' => sub { |
255 |
subtest 'get_description_by_koha_field' => sub { |
| 248 |
plan tests => 4; |
256 |
plan tests => 4; |
| 249 |
- |
|
|