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 => 48;
21
use Test::More tests => 51;
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 3544-3549 subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub { Link Here
3544
    $itemtype->rentalcharge_daily('0')->store;
3544
    $itemtype->rentalcharge_daily('0')->store;
3545
};
3545
};
3546
3546
3547
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub {
3548
    plan tests => 1;
3549
3550
    t::lib::Mocks::mock_preference('CircConfirmItemParts', 1);
3551
3552
    my $library =
3553
      $builder->build_object( { class => 'Koha::Libraries' } )->store;
3554
    my $patron = $builder->build_object(
3555
        {
3556
            class => 'Koha::Patrons',
3557
            value => { categorycode => $patron_category->{categorycode} }
3558
        }
3559
    )->store;
3560
3561
    my $itemtype = $builder->build_object(
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
        {
3575
            class => 'Koha::Items',
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
        }
3588
    )->store;
3589
3590
    my ( $issuingimpossible, $needsconfirmation );
3591
    my $dt_from = dt_from_string();
3592
    my $dt_due = $dt_from->clone->add( days => 3 );
3593
3594
    ( $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' );
3596
};
3597
3547
subtest 'Do not return on renewal (LOST charge)' => sub {
3598
subtest 'Do not return on renewal (LOST charge)' => sub {
3548
    plan tests => 1;
3599
    plan tests => 1;
3549
3600
3550
- 

Return to bug 25261