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

(-)a/t/db_dependent/Circulation.t (-2 / +35 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 116;
20
use Test::More tests => 117;
21
21
22
use DateTime;
22
use DateTime;
23
use POSIX qw( floor );
23
use POSIX qw( floor );
Lines 2192-2197 subtest 'CanBookBeIssued | is_overdue' => sub { Link Here
2192
2192
2193
};
2193
};
2194
2194
2195
subtest 'CanBookBeIssued | item-level_itypes=biblio' => sub {
2196
    plan tests => 2;
2197
2198
    t::lib::Mocks::mock_preference('item-level_itypes', 0); # biblio
2199
    my $library = $builder->build( { source => 'Branch' } );
2200
    my $patron  = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } )->store;
2201
2202
    my $itemtype = $builder->build(
2203
        {
2204
            source => 'Itemtype',
2205
            value  => { notforloan => undef, }
2206
        }
2207
    );
2208
2209
    my $biblioitem = $builder->build( { source => 'Biblioitem', value => { itemtype => $itemtype->{itemtype} } } );
2210
    my $item = $builder->build_object(
2211
        {
2212
            class => 'Koha::Items',
2213
            value  => {
2214
                homebranch    => $library->{branchcode},
2215
                holdingbranch => $library->{branchcode},
2216
                notforloan    => 0,
2217
                itemlost      => 0,
2218
                withdrawn     => 0,
2219
                biblionumber  => $biblioitem->{biblionumber},
2220
                biblioitemnumber => $biblioitem->{biblionumber},
2221
            }
2222
        }
2223
    )->store;
2224
2225
    my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, undef, undef, undef, undef );
2226
    is_deeply( $needsconfirmation, {}, 'Item can be issued to this patron' );
2227
    is_deeply( $issuingimpossible, {}, 'Item can be issued to this patron' );
2228
};
2195
2229
2196
$schema->storage->txn_rollback;
2230
$schema->storage->txn_rollback;
2197
$cache->clear_from_cache('single_holidays');
2231
$cache->clear_from_cache('single_holidays');
2198
- 

Return to bug 20825