Lines 414-420
subtest 'adjust() tests' => sub {
Link Here
|
414 |
$schema->storage->txn_rollback; |
414 |
$schema->storage->txn_rollback; |
415 |
}; |
415 |
}; |
416 |
|
416 |
|
417 |
subtest 'issue() tests' => sub { |
417 |
subtest 'checkout() tests' => sub { |
418 |
plan tests => 6; |
418 |
plan tests => 6; |
419 |
|
419 |
|
420 |
$schema->storage->txn_begin; |
420 |
$schema->storage->txn_begin; |
Lines 440-456
subtest 'issue() tests' => sub {
Link Here
|
440 |
|
440 |
|
441 |
my $line_checkout = $line->checkout; |
441 |
my $line_checkout = $line->checkout; |
442 |
is( ref($line_checkout), 'Koha::Checkout', 'Result type is correct' ); |
442 |
is( ref($line_checkout), 'Koha::Checkout', 'Result type is correct' ); |
443 |
is( $line_checkout->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->checkout should return the correct checkout'); |
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_checkout = $line->checkout; |
448 |
my $old_line_checkout = $line->checkout; |
449 |
is( ref($old_line_checkout), 'Koha::Old::Checkout', 'Result type is correct' ); |
449 |
is( ref($old_line_checkout), 'Koha::Old::Checkout', 'Result type is correct' ); |
450 |
is( $old_line_checkout->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->checkout should return the correct old_checkout' ); |
451 |
|
451 |
|
452 |
$line->issue_id(undef)->store; |
452 |
$line->issue_id(undef)->store; |
453 |
is( $line->checkout, undef, 'Koha::Account::Line->issue should return undef if no issue linked' ); |
453 |
is( $line->checkout, undef, 'Koha::Account::Line->checkout should return undef if no checkout linked' ); |
454 |
|
454 |
|
455 |
$schema->storage->txn_rollback; |
455 |
$schema->storage->txn_rollback; |
456 |
}; |
456 |
}; |
457 |
- |
|
|