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 3538-3543 subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub { Link Here
3538
    $itemtype->rentalcharge_daily('0')->store;
3538
    $itemtype->rentalcharge_daily('0')->store;
3539
};
3539
};
3540
3540
3541
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub {
3542
    plan tests => 1;
3543
3544
    t::lib::Mocks::mock_preference('CircConfirmItemParts', 1);
3545
3546
    my $library =
3547
      $builder->build_object( { class => 'Koha::Libraries' } )->store;
3548
    my $patron = $builder->build_object(
3549
        {
3550
            class => 'Koha::Patrons',
3551
            value => { categorycode => $patron_category->{categorycode} }
3552
        }
3553
    )->store;
3554
3555
    my $itemtype = $builder->build_object(
3556
        {
3557
            class => 'Koha::ItemTypes',
3558
            value => {
3559
                notforloan         => 0,
3560
                rentalcharge       => 0,
3561
                rentalcharge_daily => 0
3562
            }
3563
        }
3564
    );
3565
3566
    my $biblioitem = $builder->build( { source => 'Biblioitem' } );
3567
    my $item = $builder->build_object(
3568
        {
3569
            class => 'Koha::Items',
3570
            value => {
3571
                homebranch       => $library->id,
3572
                holdingbranch    => $library->id,
3573
                notforloan       => 0,
3574
                itemlost         => 0,
3575
                withdrawn        => 0,
3576
                itype            => $itemtype->id,
3577
                biblionumber     => $biblioitem->{biblionumber},
3578
                biblioitemnumber => $biblioitem->{biblioitemnumber},
3579
                materials        => 'includes DVD',
3580
            }
3581
        }
3582
    )->store;
3583
3584
    my ( $issuingimpossible, $needsconfirmation );
3585
    my $dt_from = dt_from_string();
3586
    my $dt_due = $dt_from->clone->add( days => 3 );
3587
3588
    ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, $dt_due, undef, undef, undef );
3589
    is_deeply( $needsconfirmation, { additional_materials => 'includes DVD' }, 'Item needs confirmation of additional parts' );
3590
};
3591
3541
subtest 'Do not return on renewal (LOST charge)' => sub {
3592
subtest 'Do not return on renewal (LOST charge)' => sub {
3542
    plan tests => 1;
3593
    plan tests => 1;
3543
3594
3544
- 

Return to bug 25261