Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 7; |
22 |
use Test::More tests => 9; |
|
|
23 |
use Test::Exception; |
23 |
|
24 |
|
24 |
use C4::Circulation; |
25 |
use C4::Circulation; |
25 |
use Koha::Checkouts; |
26 |
use Koha::Checkouts; |
Lines 56-61
is( Koha::Checkouts->search->count, $nb_of_checkouts + 2, 'The 2 checkouts shoul
Link Here
|
56 |
my $retrieved_checkout_1 = Koha::Checkouts->find( $new_checkout_1->issue_id ); |
57 |
my $retrieved_checkout_1 = Koha::Checkouts->find( $new_checkout_1->issue_id ); |
57 |
is( $retrieved_checkout_1->itemnumber, $new_checkout_1->itemnumber, 'Find a checkout by id should return the correct checkout' ); |
58 |
is( $retrieved_checkout_1->itemnumber, $new_checkout_1->itemnumber, 'Find a checkout by id should return the correct checkout' ); |
58 |
|
59 |
|
|
|
60 |
subtest 'Koha::Checkouts checkout_codes' => sub { |
61 |
plan tests => 2; |
62 |
is( $Koha::Checkouts::type->{checkout}, 'C' ); |
63 |
is( $Koha::Checkouts::type->{onsite_checkout}, 'OS' ); |
64 |
}; |
65 |
|
66 |
subtest 'is_onsite_checkout' => sub { |
67 |
plan tests => 2; |
68 |
|
69 |
my $old_checkout_type = $retrieved_checkout_1->checkout_type; |
70 |
$new_checkout_1->checkout_type($Koha::Checkouts::type->{checkout})->store; |
71 |
ok( !$new_checkout_1->is_onsite_checkout, 'It is not on-site checkout' ); |
72 |
$new_checkout_1->checkout_type($Koha::Checkouts::type->{onsite_checkout})->store; |
73 |
is( $new_checkout_1->is_onsite_checkout, |
74 |
1, 'It is an on-site checkout' ); |
75 |
$new_checkout_1->checkout_type($old_checkout_type)->store; |
76 |
}; |
77 |
|
59 |
subtest 'is_overdue' => sub { |
78 |
subtest 'is_overdue' => sub { |
60 |
plan tests => 6; |
79 |
plan tests => 6; |
61 |
my $ten_days_ago = dt_from_string->add( days => -10 ); |
80 |
my $ten_days_ago = dt_from_string->add( days => -10 ); |