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 => 51; |
21 |
use Test::More tests => 49; |
22 |
use Test::Exception; |
22 |
use Test::Exception; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
use Test::Deep qw( cmp_deeply ); |
24 |
use Test::Deep qw( cmp_deeply ); |
Lines 3549-3556
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub {
Link Here
|
3549 |
|
3549 |
|
3550 |
t::lib::Mocks::mock_preference('CircConfirmItemParts', 1); |
3550 |
t::lib::Mocks::mock_preference('CircConfirmItemParts', 1); |
3551 |
|
3551 |
|
3552 |
my $library = |
|
|
3553 |
$builder->build_object( { class => 'Koha::Libraries' } )->store; |
3554 |
my $patron = $builder->build_object( |
3552 |
my $patron = $builder->build_object( |
3555 |
{ |
3553 |
{ |
3556 |
class => 'Koha::Patrons', |
3554 |
class => 'Koha::Patrons', |
Lines 3558-3597
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub {
Link Here
|
3558 |
} |
3556 |
} |
3559 |
)->store; |
3557 |
)->store; |
3560 |
|
3558 |
|
3561 |
my $itemtype = $builder->build_object( |
3559 |
my $item = $builder->build_sample_item( |
3562 |
{ |
|
|
3563 |
class => 'Koha::ItemTypes', |
3564 |
value => { |
3565 |
notforloan => 0, |
3566 |
rentalcharge => 0, |
3567 |
rentalcharge_daily => 0 |
3568 |
} |
3569 |
} |
3570 |
); |
3571 |
|
3572 |
my $biblioitem = $builder->build( { source => 'Biblioitem' } ); |
3573 |
my $item = $builder->build_object( |
3574 |
{ |
3560 |
{ |
3575 |
class => 'Koha::Items', |
3561 |
materials => 'includes DVD', |
3576 |
value => { |
|
|
3577 |
homebranch => $library->id, |
3578 |
holdingbranch => $library->id, |
3579 |
notforloan => 0, |
3580 |
itemlost => 0, |
3581 |
withdrawn => 0, |
3582 |
itype => $itemtype->id, |
3583 |
biblionumber => $biblioitem->{biblionumber}, |
3584 |
biblioitemnumber => $biblioitem->{biblioitemnumber}, |
3585 |
materials => 'includes DVD', |
3586 |
} |
3587 |
} |
3562 |
} |
3588 |
)->store; |
3563 |
)->store; |
3589 |
|
3564 |
|
3590 |
my ( $issuingimpossible, $needsconfirmation ); |
3565 |
my $dt_due = dt_from_string->add( days => 3 ); |
3591 |
my $dt_from = dt_from_string(); |
|
|
3592 |
my $dt_due = $dt_from->clone->add( days => 3 ); |
3593 |
|
3566 |
|
3594 |
( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, $dt_due, undef, undef, undef ); |
3567 |
my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, $dt_due, undef, undef, undef ); |
3595 |
is_deeply( $needsconfirmation, { additional_materials => 'includes DVD' }, 'Item needs confirmation of additional parts' ); |
3568 |
is_deeply( $needsconfirmation, { additional_materials => 'includes DVD' }, 'Item needs confirmation of additional parts' ); |
3596 |
}; |
3569 |
}; |
3597 |
|
3570 |
|
3598 |
- |
|
|