Lines 2246-2252
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
Link Here
|
2246 |
} |
2246 |
} |
2247 |
); |
2247 |
); |
2248 |
|
2248 |
|
2249 |
|
|
|
2250 |
my ( $error, $question, $alerts ); |
2249 |
my ( $error, $question, $alerts ); |
2251 |
|
2250 |
|
2252 |
# Patron cannot issue item_1, they have overdues |
2251 |
# Patron cannot issue item_1, they have overdues |
Lines 2277-2283
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
Link Here
|
2277 |
}; |
2276 |
}; |
2278 |
|
2277 |
|
2279 |
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { |
2278 |
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { |
2280 |
plan tests => 1; |
2279 |
plan tests => 9; |
2281 |
|
2280 |
|
2282 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
2281 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
2283 |
my $patron_category_x = $builder->build_object( |
2282 |
my $patron_category_x = $builder->build_object( |
Lines 2307-2312
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
Link Here
|
2307 |
my ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_1->barcode ); |
2306 |
my ( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_1->barcode ); |
2308 |
is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' ); |
2307 |
is( $error->{STATS}, 1, '"Error" flag "STATS" must be set if CanBookBeIssued is called with a statistic patron (category_type=X)' ); |
2309 |
|
2308 |
|
|
|
2309 |
my $stat = Koha::Statistics->search( { itemnumber => $item_1->itemnumber } )->next; |
2310 |
is( $stat->branch, C4::Context->userenv->{'branch'}, 'Recorded a branch' ); |
2311 |
is( $stat->type, 'localuse', 'Recorded type as localuse' ); |
2312 |
is( $stat->itemnumber, $item_1->itemnumber, 'Recorded an itemnumber' ); |
2313 |
is( $stat->itemtype, $item_1->effective_itemtype, 'Recorded an itemtype' ); |
2314 |
is( $stat->borrowernumber, $patron->borrowernumber, 'Recorded a borrower number' ); |
2315 |
is( $stat->ccode, $item_1->ccode, 'Recorded a collection code' ); |
2316 |
is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); |
2317 |
is( $stat->location, $item_1->location, 'Recorded a location' ); |
2318 |
|
2310 |
# TODO There are other tests to provide here |
2319 |
# TODO There are other tests to provide here |
2311 |
}; |
2320 |
}; |
2312 |
|
2321 |
|
2313 |
- |
|
|