Lines 1-6
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
|
2 |
|
3 |
use Test::More tests => 15; |
3 |
use Test::More tests => 16; |
4 |
|
4 |
|
5 |
BEGIN { |
5 |
BEGIN { |
6 |
use_ok('C4::Circulation'); |
6 |
use_ok('C4::Circulation'); |
Lines 108-110
is(
Link Here
|
108 |
$CircControl, |
108 |
$CircControl, |
109 |
'CircControl reset to its initial value' |
109 |
'CircControl reset to its initial value' |
110 |
); |
110 |
); |
|
|
111 |
|
112 |
# Test C4::Circulation::ProcessOfflinePayment |
113 |
my $sth = C4::Context->dbh->prepare("SELECT COUNT(*) FROM accountlines WHERE amount = '-123.45' AND accounttype = 'Pay'"); |
114 |
$sth->execute(); |
115 |
my ( $original_count ) = $sth->fetchrow_array(); |
116 |
|
117 |
C4::Context->dbh->do("INSERT INTO borrowers ( cardnumber, surname, firstname, categorycode, branchcode ) VALUES ( '99999999999', 'Hall', 'Kyle', 'S', 'MPL' )"); |
118 |
|
119 |
C4::Circulation::ProcessOfflinePayment({ cardnumber => '99999999999', amount => '123.45' }); |
120 |
|
121 |
$sth->execute(); |
122 |
my ( $new_count ) = $sth->fetchrow_array(); |
123 |
|
124 |
ok( $new_count == $original_count + 1, 'ProcessOfflinePayment makes payment correctly' ); |
125 |
|
126 |
C4::Context->dbh->do("DELETE FROM accountlines WHERE borrowernumber IN ( SELECT borrowernumber FROM borrowers WHERE cardnumber = '99999999999' )"); |
127 |
C4::Context->dbh->do("DELETE FROM borrowers WHERE cardnumber = '99999999999'"); |