View | Details | Raw Unified | Return to bug 25261
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-2 / +52 lines)
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 => 49;
21
use Test::More tests => 50;
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 3981-3986 subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub { Link Here
3981
    $itemtype->rentalcharge_daily('0')->store;
3981
    $itemtype->rentalcharge_daily('0')->store;
3982
};
3982
};
3983
3983
3984
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub {
3985
    plan tests => 1;
3986
3987
    t::lib::Mocks::mock_preference('CircConfirmItemParts', 1);
3988
3989
    my $library =
3990
      $builder->build_object( { class => 'Koha::Libraries' } )->store;
3991
    my $patron = $builder->build_object(
3992
        {
3993
            class => 'Koha::Patrons',
3994
            value => { categorycode => $patron_category->{categorycode} }
3995
        }
3996
    )->store;
3997
3998
    my $itemtype = $builder->build_object(
3999
        {
4000
            class => 'Koha::ItemTypes',
4001
            value => {
4002
                notforloan         => 0,
4003
                rentalcharge       => 0,
4004
                rentalcharge_daily => 0
4005
            }
4006
        }
4007
    );
4008
4009
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
4010
    my $item = $builder->build_object(
4011
        {
4012
            class => 'Koha::Items',
4013
            value => {
4014
                homebranch       => $library->id,
4015
                holdingbranch    => $library->id,
4016
                notforloan       => 0,
4017
                itemlost         => 0,
4018
                withdrawn        => 0,
4019
                itype            => $itemtype->id,
4020
                biblionumber     => $biblioitem->{biblionumber},
4021
                biblioitemnumber => $biblioitem->{biblioitemnumber},
4022
                materials        => 'includes DVD',
4023
            }
4024
        }
4025
    )->store;
4026
4027
    my ( $issuingimpossible, $needsconfirmation );
4028
    my $dt_from = dt_from_string();
4029
    my $dt_due = $dt_from->clone->add( days => 3 );
4030
4031
    ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, $dt_due, undef, undef, undef );
4032
    is_deeply( $needsconfirmation, { additional_materials => 'includes DVD' }, 'Item needs confirmation of additional parts' );
4033
};
4034
3984
subtest 'Do not return on renewal (LOST charge)' => sub {
4035
subtest 'Do not return on renewal (LOST charge)' => sub {
3985
    plan tests => 1;
4036
    plan tests => 1;
3986
4037
3987
- 

Return to bug 25261