Lines 2369-2375
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub {
Link Here
|
2369 |
}; |
2369 |
}; |
2370 |
|
2370 |
|
2371 |
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { |
2371 |
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub { |
2372 |
plan tests => 9; |
2372 |
plan tests => 11; |
2373 |
|
2373 |
|
2374 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
2374 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
2375 |
my $patron_category_x = $builder->build_object( |
2375 |
my $patron_category_x = $builder->build_object( |
Lines 2409-2414
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
Link Here
|
2409 |
is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); |
2409 |
is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); |
2410 |
is( $stat->location, $item_1->location, 'Recorded a location' ); |
2410 |
is( $stat->location, $item_1->location, 'Recorded a location' ); |
2411 |
|
2411 |
|
|
|
2412 |
|
2413 |
t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); |
2414 |
my $patron_2 = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); |
2415 |
my $item_2 = $builder->build_sample_item( { library => $library->branchcode } ); |
2416 |
my $issue = AddIssue( $patron_2, $item_2->barcode ); |
2417 |
$item_2->discard_changes; |
2418 |
ok($item_2->onloan, "Item is checked out"); |
2419 |
|
2420 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode ); |
2421 |
$item_2->discard_changes; |
2422 |
ok(!$item_2->onloan, "Checked out item is returned"); |
2423 |
|
2412 |
# TODO There are other tests to provide here |
2424 |
# TODO There are other tests to provide here |
2413 |
}; |
2425 |
}; |
2414 |
|
2426 |
|
2415 |
- |
|
|