|
Lines 2434-2440
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
Link Here
|
| 2434 |
}; |
2434 |
}; |
| 2435 |
|
2435 |
|
| 2436 |
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { |
2436 |
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { |
| 2437 |
plan tests => 14; |
2437 |
plan tests => 13; |
| 2438 |
|
2438 |
|
| 2439 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
2439 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 2440 |
my $patron_category_x = $builder->build_object( |
2440 |
my $patron_category_x = $builder->build_object( |
|
Lines 2482-2491
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
Link Here
|
| 2482 |
$item_2->discard_changes; |
2482 |
$item_2->discard_changes; |
| 2483 |
ok( $item_2->onloan, "Item is checked out" ); |
2483 |
ok( $item_2->onloan, "Item is checked out" ); |
| 2484 |
|
2484 |
|
| 2485 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode ); |
|
|
| 2486 |
$item_2->discard_changes; |
| 2487 |
ok( !$item_2->onloan, "Checked out item is returned" ); |
| 2488 |
|
| 2489 |
my $item_3 = $builder->build_sample_item( { library => $library->branchcode } ); |
2485 |
my $item_3 = $builder->build_sample_item( { library => $library->branchcode } ); |
| 2490 |
CanBookBeIssued( $patron, $item_3->barcode ); |
2486 |
CanBookBeIssued( $patron, $item_3->barcode ); |
| 2491 |
$item_3->discard_changes; |
2487 |
$item_3->discard_changes; |
|
Lines 2497-2503
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
Link Here
|
| 2497 |
is( Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 1, 'Issue should be recorded in statistics table for item 4.' ); |
2493 |
is( Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 1, 'Issue should be recorded in statistics table for item 4.' ); |
| 2498 |
CanBookBeIssued( $patron, $item_4->barcode ); |
2494 |
CanBookBeIssued( $patron, $item_4->barcode ); |
| 2499 |
$item_4->discard_changes; |
2495 |
$item_4->discard_changes; |
| 2500 |
is( Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 3, 'Issue, return, and localuse should be recorded in statistics table for item 4.' ); |
2496 |
is( Koha::Statistics->search( { itemnumber => $item_4->itemnumber } )->count, 2, 'Issue and localuse should be recorded in statistics table for item 4.' ); |
| 2501 |
|
2497 |
|
| 2502 |
# TODO There are other tests to provide here |
2498 |
# TODO There are other tests to provide here |
| 2503 |
}; |
2499 |
}; |
| 2504 |
- |
|
|