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 => 9; |
19 |
use Test::More tests => 10; |
20 |
use Test::MockModule; |
20 |
use Test::MockModule; |
21 |
use Data::Dumper qw( Dumper ); |
21 |
use Data::Dumper qw( Dumper ); |
22 |
use utf8; |
22 |
use utf8; |
Lines 238-243
subtest 'default_branches_empty' => sub {
Link Here
|
238 |
is( $subfield->{marc_value}->{values}->[0], "", 'empty option for branches if default_branches_empty passed' ); |
238 |
is( $subfield->{marc_value}->{values}->[0], "", 'empty option for branches if default_branches_empty passed' ); |
239 |
}; |
239 |
}; |
240 |
|
240 |
|
|
|
241 |
subtest 'kohafields_to_add_datepicker' => sub { |
242 |
plan tests => 5; |
243 |
|
244 |
my $biblio = |
245 |
$builder->build_sample_biblio( { value => { frameworkcode => '' } } ); |
246 |
my $subfields = |
247 |
Koha::UI::Form::Builder::Item->new( |
248 |
{ biblionumber => $biblio->biblionumber } )->edit_form; |
249 |
|
250 |
my @itemfield_test_cases = ( |
251 |
{ kohafield => 'items.dateaccessioned', expected_type => 'date' }, |
252 |
{ kohafield => 'items.replacementpricedate', expected_type => 'date' }, |
253 |
{ kohafield => 'items.datelastborrowed', expected_type => 'date' }, |
254 |
{ kohafield => 'items.onloan', expected_type => 'date' }, |
255 |
{ kohafield => 'items.datelastseen', expected_type => 'datetime' }, |
256 |
); |
257 |
|
258 |
foreach my $itemfield_test_case (@itemfield_test_cases) { |
259 |
my ( $subfield ) = grep { $_->{kohafield} eq $itemfield_test_case->{kohafield} } @$subfields; |
260 |
if ( $subfield ) { |
261 |
is( $subfield->{datetype}, $itemfield_test_case->{expected_type}, "Correct datetype for $itemfield_test_case->{kohafield}" ); |
262 |
} else { |
263 |
ok( 0, "Subfield for $itemfield_test_case->{kohafield} not found" ); |
264 |
} |
265 |
} |
266 |
}; |
267 |
|
241 |
subtest 'kohafields_to_ignore' => sub { |
268 |
subtest 'kohafields_to_ignore' => sub { |
242 |
plan tests => 2; |
269 |
plan tests => 2; |
243 |
|
270 |
|
244 |
- |
|
|