Lines 2474-2490
subtest 'CanBookBeIssued + Statistic patrons "X"' => sub {
Link Here
|
2474 |
is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); |
2474 |
is( $stat->categorycode, $patron->categorycode, 'Recorded a categorycode' ); |
2475 |
is( $stat->location, $item_1->location, 'Recorded a location' ); |
2475 |
is( $stat->location, $item_1->location, 'Recorded a location' ); |
2476 |
|
2476 |
|
2477 |
|
2477 |
t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } ); |
2478 |
t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); |
2478 |
my $patron_2 = $builder->build_object( |
2479 |
my $patron_2 = $builder->build_object( { class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); |
2479 |
{ class => 'Koha::Patrons', value => { categorycode => $patron_category->{categorycode} } } ); |
2480 |
my $item_2 = $builder->build_sample_item( { library => $library->branchcode } ); |
2480 |
my $item_2 = $builder->build_sample_item( { library => $library->branchcode } ); |
2481 |
my $issue = AddIssue( $patron_2, $item_2->barcode ); |
2481 |
my $issue = AddIssue( $patron_2, $item_2->barcode ); |
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 ); |
2485 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron, $item_2->barcode ); |
2486 |
$item_2->discard_changes; |
2486 |
$item_2->discard_changes; |
2487 |
ok(!$item_2->onloan, "Checked out item is returned"); |
2487 |
ok( !$item_2->onloan, "Checked out item is returned" ); |
2488 |
|
2488 |
|
2489 |
# TODO There are other tests to provide here |
2489 |
# TODO There are other tests to provide here |
2490 |
}; |
2490 |
}; |
2491 |
- |
|
|