|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
| 21 |
|
21 |
|
| 22 |
use Test::More tests => 10; |
22 |
use Test::More tests => 11; |
| 23 |
|
23 |
|
| 24 |
use C4::Circulation qw( MarkIssueReturned AddReturn ); |
24 |
use C4::Circulation qw( MarkIssueReturned AddReturn ); |
| 25 |
use Koha::Checkouts; |
25 |
use Koha::Checkouts; |
|
Lines 110-115
subtest 'item' => sub {
Link Here
|
| 110 |
'Koha::Checkout->item should return the correct item' ); |
110 |
'Koha::Checkout->item should return the correct item' ); |
| 111 |
}; |
111 |
}; |
| 112 |
|
112 |
|
|
|
113 |
subtest 'accountlines' => sub { |
| 114 |
plan tests => 3; |
| 115 |
|
| 116 |
my $accountline = Koha::Account::Line->new( |
| 117 |
{ |
| 118 |
issue_id => $retrieved_checkout_1->id, |
| 119 |
borrowernumber => $retrieved_checkout_1->borrowernumber, |
| 120 |
itemnumber => $retrieved_checkout_1->itemnumber, |
| 121 |
branchcode => $retrieved_checkout_1->branchcode, |
| 122 |
date => \'NOW()', |
| 123 |
debit_type_code => 'OVERDUE', |
| 124 |
status => 'UNRETURNED', |
| 125 |
interface => 'cli', |
| 126 |
amount => '1', |
| 127 |
amountoutstanding => '1', |
| 128 |
} |
| 129 |
)->store(); |
| 130 |
|
| 131 |
my $accountlines = $retrieved_checkout_1->accountlines; |
| 132 |
is( ref($accountlines), 'Koha::Account::Lines', |
| 133 |
'Koha::Checkout->accountlines should return a Koha::Item' ); |
| 134 |
|
| 135 |
my $line = $accountlines->next; |
| 136 |
is( ref($line), 'Koha::Account::Line', |
| 137 |
'next returns a Koha::Account::Line' ); |
| 138 |
|
| 139 |
is( |
| 140 |
$accountline->id, |
| 141 |
$line->id, |
| 142 |
'Koha::Checkout->accountlines should return the correct accountlines' |
| 143 |
); |
| 144 |
}; |
| 145 |
|
| 113 |
subtest 'patron' => sub { |
146 |
subtest 'patron' => sub { |
| 114 |
plan tests => 3; |
147 |
plan tests => 3; |
| 115 |
my $patron = $builder->build_object( |
148 |
my $patron = $builder->build_object( |
| 116 |
- |
|
|