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

(-)a/t/db_dependent/Reserves.t (-2 / +27 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 77;
20
use Test::More tests => 78;
21
use Test::MockModule;
21
use Test::MockModule;
22
use Test::Warn;
22
use Test::Warn;
23
23
Lines 1735-1737 subtest 'CanItemBeReserved() tests' => sub { Link Here
1735
1735
1736
    $schema->storage->txn_rollback;
1736
    $schema->storage->txn_rollback;
1737
};
1737
};
1738
- 
1738
1739
subtest 'DefaultHoldExpiration tests' => sub {
1740
    plan tests => 2;
1741
    $schema->storage->txn_begin;
1742
1743
    t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdate', 1 );
1744
    t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdatePeriod', 365 );
1745
    t::lib::Mocks::mock_preference( 'DefaultHoldExpirationUnitOfTime', 'days;' );
1746
1747
    my $patron  = $builder->build_object( { class => 'Koha::Patrons' } );
1748
    my $item    = $builder->build_sample_item();
1749
1750
    my $reserve_id = AddReserve({
1751
        branchcode     => $item->homebranch,
1752
        borrowernumber => $patron->id,
1753
        biblionumber   => $item->biblionumber,
1754
    });
1755
1756
    my $today = dt_from_string();
1757
    my $hold = Koha::Holds->find( $reserve_id );
1758
1759
    is( $hold->reservedate, $today->ymd, "Hold created today" );
1760
    is( $hold->expirationdate, $today->add( days => 365)->ymd, "Reserve date set 1 year from today" );
1761
1762
    $schema->txn_rollback;
1763
};

Return to bug 33611