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

(-)a/t/db_dependent/Circulation.t (-2 / +40 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 => 63;
21
use Test::More tests => 67;
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 5693-5698 subtest "GetSoonestRenewDate tests" => sub { Link Here
5693
    );
5693
    );
5694
};
5694
};
5695
5695
5696
subtest "CanBookBeIssued + needsconfirmation message" => sub {
5697
    plan tests => 4;
5698
5699
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
5700
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
5701
    my $biblio = $builder->build_object({ class => 'Koha::Biblios' });
5702
    my $biblioitem = $builder->build_object({ class => 'Koha::Biblioitems', value => { biblionumber => $biblio->biblionumber }});
5703
    my $item = $builder->build_object({ class => 'Koha::Items' , value => { biblionumber => $biblio->biblionumber }});
5704
5705
    my $hold = $builder->build_object({ class => 'Koha::Holds', value => {
5706
        biblionumber => $item->biblionumber,
5707
        branchcode => $library->branchcode,
5708
        itemnumber => undef,
5709
        itemtype => undef,
5710
        priority => 1,
5711
        found => undef,
5712
        suspend => 0,
5713
    }});
5714
5715
    my ( $error, $needsconfirmation, $alerts, $messages );
5716
5717
    ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode );
5718
    is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold exists.");
5719
5720
    $hold->priority(0)->store();
5721
5722
    $hold->found("W")->store();
5723
    ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode );
5724
    is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold is waiting.");
5725
5726
    $hold->found("T")->store();
5727
    ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode );
5728
    is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold is being transferred.");
5729
5730
    $hold->found("P")->store();
5731
    ( $error, $needsconfirmation, $alerts, $messages ) = CanBookBeIssued( $patron, $item->barcode );
5732
    is($needsconfirmation->{resbranchcode}, $hold->branchcode, "Branchcodes match when hold is being processed.");
5733
};
5734
5696
$schema->storage->txn_rollback;
5735
$schema->storage->txn_rollback;
5697
C4::Context->clear_syspref_cache();
5736
C4::Context->clear_syspref_cache();
5698
$branches = Koha::Libraries->search();
5737
$branches = Koha::Libraries->search();
5699
- 

Return to bug 31447