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

(-)a/t/db_dependent/Circulation.t (-3 / +12 lines)
Lines 1973-1979 subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { Link Here
1973
};
1973
};
1974
1974
1975
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
1975
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
1976
    plan tests => 1;
1976
    plan tests => 3;
1977
1977
1978
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
1978
    my $library = $builder->build_object( { class => 'Koha::Libraries' } );
1979
    my $patron_category_x = $builder->build_object(
1979
    my $patron_category_x = $builder->build_object(
Lines 1996-2008 subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { Link Here
1996
    );
1996
    );
1997
    my $item_1 = $builder->build_sample_item(
1997
    my $item_1 = $builder->build_sample_item(
1998
        {
1998
        {
1999
            library => $library->{branchcode},
1999
            library => $library->branchcode,
2000
        }
2000
        }
2001
    );
2001
    );
2002
2002
2003
    my ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_1->barcode );
2003
    my ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_1->barcode );
2004
    is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' );
2004
    is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' );
2005
2005
2006
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2007
    my $patron_2  = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } );
2008
    my $item_2 = $builder->build_sample_item({library => $library->branchcode});
2009
    my $issue = AddIssue( $patron_2->unblessed, $item_2->barcode );
2010
    $item_2->discard_changes;
2011
    ok($item_2->onloan, "Item checked out");
2012
    ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode );
2013
    $item_2->discard_changes;
2014
    ok(!$item_2->onloan, "CanBookBeIssued returns a checked out item when adding a statistical checkout count");
2015
2006
    # TODO There are other tests to provide here
2016
    # TODO There are other tests to provide here
2007
};
2017
};
2008
2018
2009
- 

Return to bug 27992