Lines 20-28
use Modern::Perl;
Link Here
|
20 |
use Test::More tests => 4; |
20 |
use Test::More tests => 4; |
21 |
use Test::Exception; |
21 |
use Test::Exception; |
22 |
|
22 |
|
23 |
use Koha::City; |
23 |
use C4::Calendar; |
24 |
use Koha::CurbsidePickups; |
24 |
use Koha::CurbsidePickups; |
25 |
use Koha::CurbsidePickupPolicies; |
25 |
use Koha::CurbsidePickupPolicies; |
|
|
26 |
use Koha::Calendar; |
26 |
use Koha::Database; |
27 |
use Koha::Database; |
27 |
use Koha::DateUtils qw( dt_from_string ); |
28 |
use Koha::DateUtils qw( dt_from_string ); |
28 |
|
29 |
|
Lines 77-83
$policy->add_opening_slot('1-12:00-18:00');
Link Here
|
77 |
my $today = dt_from_string; |
78 |
my $today = dt_from_string; |
78 |
|
79 |
|
79 |
subtest 'Create a pickup' => sub { |
80 |
subtest 'Create a pickup' => sub { |
80 |
plan tests => 8; |
81 |
plan tests => 9; |
81 |
|
82 |
|
82 |
# Day and datetime are ok |
83 |
# Day and datetime are ok |
83 |
my $next_monday = |
84 |
my $next_monday = |
Lines 144-149
subtest 'Create a pickup' => sub {
Link Here
|
144 |
'Koha::Exceptions::CurbsidePickup::NoMatchingSlots', |
145 |
'Koha::Exceptions::CurbsidePickup::NoMatchingSlots', |
145 |
'Cannot create a pickup on a time that is not matching the start of an interval'; |
146 |
'Cannot create a pickup on a time that is not matching the start of an interval'; |
146 |
|
147 |
|
|
|
148 |
# Day is a holiday |
149 |
Koha::Caches->get_instance->flush_all; |
150 |
C4::Calendar->new( branchcode => $library->branchcode )->insert_week_day_holiday( |
151 |
weekday => 1, |
152 |
title => '', |
153 |
description => 'Mondays', |
154 |
); |
155 |
my $calendar = Koha::Calendar->new( branchcode => $library->branchcode ); |
156 |
throws_ok { |
157 |
Koha::CurbsidePickup->new({%$params, scheduled_pickup_datetime => $schedule_dt})->store; |
158 |
} |
159 |
'Koha::Exceptions::CurbsidePickup::LibraryIsClosed', |
160 |
'Cannot create a pickup on a holiday'; |
161 |
|
162 |
C4::Context->dbh->do(q{DELETE FROM repeatable_holidays}); |
163 |
Koha::Caches->get_instance->flush_all; |
147 |
}; |
164 |
}; |
148 |
|
165 |
|
149 |
subtest 'workflow' => sub { |
166 |
subtest 'workflow' => sub { |
150 |
- |
|
|