|
Lines 18-24
Link Here
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
use utf8; |
19 |
use utf8; |
| 20 |
|
20 |
|
| 21 |
use Test::More tests => 48; |
21 |
use Test::More tests => 49; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
use Test::Deep qw( cmp_deeply ); |
23 |
use Test::Deep qw( cmp_deeply ); |
| 24 |
|
24 |
|
|
Lines 3730-3735
subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub {
Link Here
|
| 3730 |
$itemtype->rentalcharge_daily('0')->store; |
3730 |
$itemtype->rentalcharge_daily('0')->store; |
| 3731 |
}; |
3731 |
}; |
| 3732 |
|
3732 |
|
|
|
3733 |
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub { |
| 3734 |
plan tests => 1; |
| 3735 |
|
| 3736 |
t::lib::Mocks::mock_preference('CircConfirmItemParts', 1); |
| 3737 |
|
| 3738 |
my $library = |
| 3739 |
$builder->build_object( { class => 'Koha::Libraries' } )->store; |
| 3740 |
my $patron = $builder->build_object( |
| 3741 |
{ |
| 3742 |
class => 'Koha::Patrons', |
| 3743 |
value => { categorycode => $patron_category->{categorycode} } |
| 3744 |
} |
| 3745 |
)->store; |
| 3746 |
|
| 3747 |
my $itemtype = $builder->build_object( |
| 3748 |
{ |
| 3749 |
class => 'Koha::ItemTypes', |
| 3750 |
value => { |
| 3751 |
notforloan => 0, |
| 3752 |
rentalcharge => 0, |
| 3753 |
rentalcharge_daily => 0 |
| 3754 |
} |
| 3755 |
} |
| 3756 |
); |
| 3757 |
|
| 3758 |
my $biblioitem = $builder->build( { source => 'Biblioitem' } ); |
| 3759 |
my $item = $builder->build_object( |
| 3760 |
{ |
| 3761 |
class => 'Koha::Items', |
| 3762 |
value => { |
| 3763 |
homebranch => $library->id, |
| 3764 |
holdingbranch => $library->id, |
| 3765 |
notforloan => 0, |
| 3766 |
itemlost => 0, |
| 3767 |
withdrawn => 0, |
| 3768 |
itype => $itemtype->id, |
| 3769 |
biblionumber => $biblioitem->{biblionumber}, |
| 3770 |
biblioitemnumber => $biblioitem->{biblioitemnumber}, |
| 3771 |
materials => 'includes DVD', |
| 3772 |
} |
| 3773 |
} |
| 3774 |
)->store; |
| 3775 |
|
| 3776 |
my ( $issuingimpossible, $needsconfirmation ); |
| 3777 |
my $dt_from = dt_from_string(); |
| 3778 |
my $dt_due = $dt_from->clone->add( days => 3 ); |
| 3779 |
|
| 3780 |
( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, $dt_due, undef, undef, undef ); |
| 3781 |
is_deeply( $needsconfirmation, { additional_materials => 'includes DVD' }, 'Item needs confirmation of additional parts' ); |
| 3782 |
}; |
| 3783 |
|
| 3733 |
subtest "Test Backdating of Returns" => sub { |
3784 |
subtest "Test Backdating of Returns" => sub { |
| 3734 |
plan tests => 2; |
3785 |
plan tests => 2; |
| 3735 |
|
3786 |
|
| 3736 |
- |
|
|