Lines 41-47
use Test::Exception;
Link Here
|
41 |
use Test::Deep qw/ cmp_deeply ignore /; |
41 |
use Test::Deep qw/ cmp_deeply ignore /; |
42 |
use Test::Warn; |
42 |
use Test::Warn; |
43 |
|
43 |
|
44 |
use Test::More tests => 13; |
44 |
use Test::More tests => 14; |
45 |
|
45 |
|
46 |
my $schema = Koha::Database->new->schema; |
46 |
my $schema = Koha::Database->new->schema; |
47 |
my $builder = t::lib::TestBuilder->new; |
47 |
my $builder = t::lib::TestBuilder->new; |
Lines 1178-1183
subtest 'Checking out' => sub {
Link Here
|
1178 |
$schema->storage->txn_rollback; |
1178 |
$schema->storage->txn_rollback; |
1179 |
}; |
1179 |
}; |
1180 |
|
1180 |
|
|
|
1181 |
subtest 'Checking out with custom due date' => sub { |
1182 |
plan tests => 1; |
1183 |
$schema->storage->txn_begin; |
1184 |
|
1185 |
my $library = $builder->build_object({ class => 'Koha::Libraries' }); |
1186 |
my $patron = $builder->build_object({ |
1187 |
class => 'Koha::Patrons', |
1188 |
value => { category_type => 'x' } |
1189 |
}); |
1190 |
my $biblio = $builder->build_sample_biblio(); |
1191 |
my $itemtype_loanable = $builder->build_object({ |
1192 |
class => 'Koha::ItemTypes', |
1193 |
value => { |
1194 |
notforloan => 0 |
1195 |
} |
1196 |
}); |
1197 |
my $request = $builder->build_object({ |
1198 |
class => 'Koha::Illrequests', |
1199 |
value => { |
1200 |
borrowernumber => $patron->borrowernumber, |
1201 |
biblio_id => $biblio->biblionumber |
1202 |
} |
1203 |
}); |
1204 |
|
1205 |
t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); |
1206 |
my $duedate = '2099-05-21 00:00:00'; |
1207 |
my $form_stage_loanable = $request->check_out({ |
1208 |
stage => 'form', |
1209 |
item_type => $itemtype_loanable->itemtype, |
1210 |
branchcode => $library->branchcode, |
1211 |
duedate => $duedate |
1212 |
}); |
1213 |
is($patron->checkouts->next->date_due, $duedate, "Custom due date was used"); |
1214 |
|
1215 |
$schema->storage->txn_rollback; |
1216 |
}; |
1217 |
|
1181 |
subtest 'Checking Limits' => sub { |
1218 |
subtest 'Checking Limits' => sub { |
1182 |
|
1219 |
|
1183 |
plan tests => 30; |
1220 |
plan tests => 30; |
1184 |
- |
|
|