|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 58; |
20 |
use Test::More tests => 59; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Data::Dumper; |
22 |
use Data::Dumper; |
| 23 |
use C4::Context; |
23 |
use C4::Context; |
|
Lines 245-250
ok( $borrower->{userid}, 'A userid should have been generated correctly' );
Link Here
|
| 245 |
is( Check_Userid( C4::Context->config('user'), '' ), 0, |
245 |
is( Check_Userid( C4::Context->config('user'), '' ), 0, |
| 246 |
'Check_Userid should return 0 for the DB user (Bug 12226)'); |
246 |
'Check_Userid should return 0 for the DB user (Bug 12226)'); |
| 247 |
|
247 |
|
|
|
248 |
subtest 'GetMemberAccountRecords' => sub { |
| 249 |
|
| 250 |
plan tests => 2; |
| 251 |
|
| 252 |
my $borrowernumber = $builder->build({ source => 'Borrower' })->{ borrowernumber }; |
| 253 |
my $accountline_1 = $builder->build({ |
| 254 |
source => 'Accountline', |
| 255 |
value => { |
| 256 |
borrowernumber => $borrowernumber, |
| 257 |
amountoutstanding => 64.60 |
| 258 |
} |
| 259 |
}); |
| 260 |
|
| 261 |
my ($total,undef,undef) = GetMemberAccountRecords( $borrowernumber ); |
| 262 |
is( $total , 64.60, "Rounding works correctly in total calculation (single value)" ); |
| 263 |
|
| 264 |
my $accountline_2 = $builder->build({ |
| 265 |
source => 'Accountline', |
| 266 |
value => { |
| 267 |
borrowernumber => $borrowernumber, |
| 268 |
amountoutstanding => 10.65 |
| 269 |
} |
| 270 |
}); |
| 271 |
|
| 272 |
($total,undef,undef) = GetMemberAccountRecords( $borrowernumber ); |
| 273 |
is( $total , 75.25, "Rounding works correctly in total calculation (multiple values)" ); |
| 274 |
|
| 275 |
}; |
| 276 |
|
| 248 |
subtest 'GetMemberAccountBalance' => sub { |
277 |
subtest 'GetMemberAccountBalance' => sub { |
| 249 |
|
278 |
|
| 250 |
plan tests => 10; |
279 |
plan tests => 10; |
| 251 |
- |
|
|