Lines 132-140
subtest 'total_outstanding() tests' => sub {
Link Here
|
132 |
$schema->storage->txn_rollback; |
132 |
$schema->storage->txn_rollback; |
133 |
}; |
133 |
}; |
134 |
|
134 |
|
135 |
subtest 'is_credit() tests' => sub { |
135 |
subtest 'is_credit() and is_debit() tests' => sub { |
136 |
|
136 |
|
137 |
plan tests => 2; |
137 |
plan tests => 4; |
138 |
|
138 |
|
139 |
$schema->storage->txn_begin; |
139 |
$schema->storage->txn_begin; |
140 |
|
140 |
|
Lines 144-149
subtest 'is_credit() tests' => sub {
Link Here
|
144 |
my $credit = $account->add_credit({ amount => 100, user_id => $patron->id }); |
144 |
my $credit = $account->add_credit({ amount => 100, user_id => $patron->id }); |
145 |
|
145 |
|
146 |
ok( $credit->is_credit, 'is_credit detects credits' ); |
146 |
ok( $credit->is_credit, 'is_credit detects credits' ); |
|
|
147 |
ok( !$credit->is_debit, 'is_debit detects credits' ); |
147 |
|
148 |
|
148 |
my $debit = Koha::Account::Line->new( |
149 |
my $debit = Koha::Account::Line->new( |
149 |
{ |
150 |
{ |
Lines 152-158
subtest 'is_credit() tests' => sub {
Link Here
|
152 |
amount => 10, |
153 |
amount => 10, |
153 |
})->store; |
154 |
})->store; |
154 |
|
155 |
|
155 |
ok( !$debit->is_credit, 'is_credit() detects debits' ); |
156 |
ok( !$debit->is_credit, 'is_credit detects debits' ); |
|
|
157 |
ok( $debit->is_debit, 'is_debit detects debits'); |
156 |
|
158 |
|
157 |
$schema->storage->txn_rollback; |
159 |
$schema->storage->txn_rollback; |
158 |
}; |
160 |
}; |
159 |
- |
|
|