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

(-)a/t/db_dependent/Circulation/dateexpiry.t (-5 / +20 lines)
Lines 34-39 my $builder = t::lib::TestBuilder->new(); Link Here
34
34
35
$ENV{ DEBUG } = 0;
35
$ENV{ DEBUG } = 0;
36
36
37
my $patron_category = $builder->build({ source => 'Category', value => { categorycode => 'NOT_X', category_type => 'P', enrolmentfee => 0 } });
38
37
subtest 'Tests for CanBookBeIssued related to dateexpiry' => sub {
39
subtest 'Tests for CanBookBeIssued related to dateexpiry' => sub {
38
    plan tests => 4;
40
    plan tests => 4;
39
    can_book_be_issued();
41
    can_book_be_issued();
Lines 47-53 sub can_book_be_issued { Link Here
47
    my $item    = $builder->build( { source => 'Item' } );
49
    my $item    = $builder->build( { source => 'Item' } );
48
    my $patron  = $builder->build(
50
    my $patron  = $builder->build(
49
        {   source => 'Borrower',
51
        {   source => 'Borrower',
50
            value  => { dateexpiry => '9999-12-31' }
52
            value  => {
53
                dateexpiry => '9999-12-31',
54
                categorycode => $patron_category->{categorycode},
55
            }
51
        }
56
        }
52
    );
57
    );
53
    $patron->{flags} = C4::Members::patronflags( $patron );
58
    $patron->{flags} = C4::Members::patronflags( $patron );
Lines 60-66 sub can_book_be_issued { Link Here
60
    $item = $builder->build( { source => 'Item' } );
65
    $item = $builder->build( { source => 'Item' } );
61
    $patron = $builder->build(
66
    $patron = $builder->build(
62
        {   source => 'Borrower',
67
        {   source => 'Borrower',
63
            value  => { dateexpiry => '0000-00-00' }
68
            value  => {
69
                dateexpiry => '0000-00-00',
70
                categorycode => $patron_category->{categorycode},
71
            }
64
        }
72
        }
65
    );
73
    );
66
    $patron->{flags} = C4::Members::patronflags( $patron );
74
    $patron->{flags} = C4::Members::patronflags( $patron );
Lines 71-77 sub can_book_be_issued { Link Here
71
    $item = $builder->build( { source => 'Item' } );
79
    $item = $builder->build( { source => 'Item' } );
72
    $patron = $builder->build(
80
    $patron = $builder->build(
73
        {   source => 'Borrower',
81
        {   source => 'Borrower',
74
            value  => { dateexpiry => output_pref( { dt => $tomorrow, dateonly => 1, dateformat => 'sql' } ) },
82
            value  => {
83
                dateexpiry => output_pref( { dt => $tomorrow, dateonly => 1, dateformat => 'sql' } ),
84
                categorycode => $patron_category->{categorycode},
85
            },
75
        }
86
        }
76
    );
87
    );
77
    $patron->{flags} = C4::Members::patronflags( $patron );
88
    $patron->{flags} = C4::Members::patronflags( $patron );
Lines 85-91 sub calc_date_due { Link Here
85
96
86
    # this triggers the compare between expiry and due date
97
    # this triggers the compare between expiry and due date
87
98
88
    my $patron = $builder->build( { source => 'Borrower' } );
99
    my $patron = $builder->build({
100
        source => 'Borrower',
101
        value  => {
102
            categorycode => $patron_category->{categorycode},
103
        }
104
    });
89
    my $item   = $builder->build( { source => 'Item' } );
105
    my $item   = $builder->build( { source => 'Item' } );
90
    my $branch = $builder->build( { source => 'Branch' } );
106
    my $branch = $builder->build( { source => 'Branch' } );
91
    my $today  = dt_from_string();
107
    my $today  = dt_from_string();
92
- 

Return to bug 19517