|
Lines 73-79
subtest 'GetByCode' => sub {
Link Here
|
| 73 |
|
73 |
|
| 74 |
subtest 'GetDescriptionByKohaField' => sub { |
74 |
subtest 'GetDescriptionByKohaField' => sub { |
| 75 |
|
75 |
|
| 76 |
plan tests => 7; |
76 |
plan tests => 8; |
| 77 |
|
77 |
|
| 78 |
$schema->storage->txn_begin; |
78 |
$schema->storage->txn_begin; |
| 79 |
|
79 |
|
|
Lines 145-150
subtest 'GetDescriptionByKohaField' => sub {
Link Here
|
| 145 |
$av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( |
145 |
$av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( |
| 146 |
{ kohafield => 'dummy.field', authorised_value => $non_existent_av } ); |
146 |
{ kohafield => 'dummy.field', authorised_value => $non_existent_av } ); |
| 147 |
is( $av, $non_existent_av, 'If both OPAC and staff descriptions are missing, the parameter should be displayed'); |
147 |
is( $av, $non_existent_av, 'If both OPAC and staff descriptions are missing, the parameter should be displayed'); |
|
|
148 |
$av = Koha::Template::Plugin::AuthorisedValues->GetDescriptionByKohaField( |
| 149 |
{ kohafield => 'dummy.field', authorised_value => undef } ); |
| 150 |
is( $av, '', 'If both OPAC and staff descriptions are missing, and the parameter is undef, an empty string should be displayed'); |
| 148 |
|
151 |
|
| 149 |
$schema->storage->txn_rollback; |
152 |
$schema->storage->txn_rollback; |
| 150 |
}; |
153 |
}; |
| 151 |
- |
|
|