Lines 438-456
subtest 'issue() tests' => sub {
Link Here
|
438 |
amount => 10, |
438 |
amount => 10, |
439 |
})->store; |
439 |
})->store; |
440 |
|
440 |
|
441 |
my $line_issue = $line->issue; |
441 |
my $line_checkout = $line->checkout; |
442 |
is( ref($line_issue), 'Koha::Checkout', 'Result type is correct' ); |
442 |
is( ref($line_checkout), 'Koha::Checkout', 'Result type is correct' ); |
443 |
is( $line_issue->issue_id, $checkout->issue_id, 'Koha::Account::Line->issue should return the correct issue'); |
443 |
is( $line_checkout->issue_id, $checkout->issue_id, 'Koha::Account::Line->issue should return the correct issue'); |
444 |
|
444 |
|
445 |
my ( $returned, undef, $old_checkout) = C4::Circulation::AddReturn( $item->{barcode} ,$library->{branchcode} ); |
445 |
my ( $returned, undef, $old_checkout) = C4::Circulation::AddReturn( $item->{barcode} ,$library->{branchcode} ); |
446 |
is( $returned, 1, 'The item should have been returned' ); |
446 |
is( $returned, 1, 'The item should have been returned' ); |
447 |
|
447 |
|
448 |
my $old_line_issue = $line->issue; |
448 |
my $old_line_checkout = $line->checkout; |
449 |
is( ref($old_line_issue), 'Koha::Old::Checkout', 'Result type is correct' ); |
449 |
is( ref($old_line_checkout), 'Koha::Old::Checkout', 'Result type is correct' ); |
450 |
is( $old_line_issue->issue_id, $old_checkout->issue_id, 'Koha::Account::Line->issue should return the correct old_issue' ); |
450 |
is( $old_line_checkout->issue_id, $old_checkout->issue_id, 'Koha::Account::Line->issue should return the correct old_issue' ); |
451 |
|
451 |
|
452 |
$line->issue_id(undef)->store; |
452 |
$line->issue_id(undef)->store; |
453 |
is( $line->issue, undef, 'Koha::Account::Line->issue should return undef if no issue linked' ); |
453 |
is( $line->checkout, undef, 'Koha::Account::Line->issue should return undef if no issue linked' ); |
454 |
|
454 |
|
455 |
$schema->storage->txn_rollback; |
455 |
$schema->storage->txn_rollback; |
456 |
}; |
456 |
}; |
457 |
- |
|
|