Lines 16-22
Link Here
|
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use Test::More tests=> 7; |
19 |
use Test::More tests=> 8; |
20 |
use utf8; |
20 |
use utf8; |
21 |
|
21 |
|
22 |
use Koha::Database; |
22 |
use Koha::Database; |
Lines 154-159
subtest 'blank' => sub {
Link Here
|
154 |
|
154 |
|
155 |
}; |
155 |
}; |
156 |
|
156 |
|
|
|
157 |
subtest 'permanent_location' => sub { |
158 |
|
159 |
# This is a special case as some libraries add this field in the frameworks |
160 |
# to allow explicitly setting a temporary location. |
161 |
# When mapped an empty value is submitted in the form with the key of permanent_location |
162 |
|
163 |
plan tests => 2; |
164 |
|
165 |
$items->batch_update({ |
166 |
new_values => { |
167 |
'permanent_location' => 'perm', |
168 |
'location' => 'loc' |
169 |
} |
170 |
}); |
171 |
$items->reset; |
172 |
|
173 |
$item = $item->get_from_storage; |
174 |
is( $item->permanent_location, 'perm', 'Updated as expected when value passed'); |
175 |
|
176 |
$items->batch_update({ |
177 |
new_values => { |
178 |
'permanent_location' => '', |
179 |
'location' => 'new_loc' |
180 |
} |
181 |
}); |
182 |
$items->reset; |
183 |
|
184 |
$item = $item->get_from_storage; |
185 |
is( $item->permanent_location, 'perm', 'Permanent location not updated when mapped, so key present, but no value passed '); |
186 |
|
187 |
}; |
188 |
|
157 |
subtest 'regex' => sub { |
189 |
subtest 'regex' => sub { |
158 |
plan tests => 12; |
190 |
plan tests => 12; |
159 |
|
191 |
|