Lines 18-24
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::NoWarnings; |
20 |
use Test::NoWarnings; |
21 |
use Test::More tests => 3; |
21 |
use Test::More tests => 4; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
|
24 |
|
Lines 85-102
subtest "Bug 34529: Offline circulation should be able to accept userid as well
Link Here
|
85 |
} |
85 |
} |
86 |
); |
86 |
); |
87 |
|
87 |
|
|
|
88 |
my ( $message, $checkout ) = ProcessOfflineIssue( |
89 |
{ |
90 |
cardnumber => $borrower1->{cardnumber}, |
91 |
barcode => $item1->barcode |
92 |
} |
93 |
); |
94 |
|
88 |
is( |
95 |
is( |
89 |
ProcessOfflineIssue( |
96 |
$message, "Success.", |
90 |
{ |
|
|
91 |
cardnumber => $borrower1->{cardnumber}, |
92 |
barcode => $item1->barcode |
93 |
} |
94 |
), |
95 |
"Success.", |
96 |
"ProcessOfflineIssue succeeds with cardnumber" |
97 |
"ProcessOfflineIssue succeeds with cardnumber" |
97 |
); |
98 |
); |
|
|
99 |
|
100 |
( $message, $checkout ) = ProcessOfflineIssue( { cardnumber => $borrower1->{userid}, barcode => $item2->barcode } ); |
98 |
is( |
101 |
is( |
99 |
ProcessOfflineIssue( { cardnumber => $borrower1->{userid}, barcode => $item2->barcode } ), |
102 |
$message, |
100 |
"Success.", |
103 |
"Success.", |
101 |
"ProcessOfflineIssue succeeds with user id" |
104 |
"ProcessOfflineIssue succeeds with user id" |
102 |
); |
105 |
); |
Lines 192-200
subtest "Bug 30114 - Koha offline circulation will always cancel the next hold w
Link Here
|
192 |
|
195 |
|
193 |
my $op = GetOfflineOperation( $offline_rs->next->id ); |
196 |
my $op = GetOfflineOperation( $offline_rs->next->id ); |
194 |
|
197 |
|
195 |
my $ret = ProcessOfflineOperation($op); |
198 |
my ($ret) = ProcessOfflineOperation($op); |
196 |
|
199 |
|
197 |
is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Still found two holds for the record" ); |
200 |
is( Koha::Holds->search( { biblionumber => $biblionumber } )->count, 2, "Still found two holds for the record" ); |
198 |
}; |
201 |
}; |
199 |
|
202 |
|
|
|
203 |
subtest "Bug 32934: ProcessOfflineIssue returns checkout object for SIP no block due date" => sub { |
204 |
plan tests => 4; |
205 |
|
206 |
$branch = $builder->build( { source => 'Branch' } )->{branchcode}; |
207 |
$manager_id = $builder->build( { source => 'Borrower' } )->{borrowernumber}; |
208 |
|
209 |
my $borrower = $builder->build( |
210 |
{ |
211 |
source => 'Borrower', |
212 |
value => { branchcode => $branch } |
213 |
} |
214 |
); |
215 |
|
216 |
my $biblio = $builder->build_sample_biblio; |
217 |
my $item = $builder->build_sample_item( |
218 |
{ |
219 |
biblionumber => $biblio->id, |
220 |
library => $branch, |
221 |
} |
222 |
); |
223 |
|
224 |
my $due_date = dt_from_string->add( days => 7 )->ymd; |
225 |
|
226 |
# Test ProcessOfflineIssue returns both message and checkout object |
227 |
my ( $message, $checkout ) = ProcessOfflineIssue( |
228 |
{ |
229 |
cardnumber => $borrower->{cardnumber}, |
230 |
barcode => $item->barcode, |
231 |
due_date => $due_date, |
232 |
timestamp => dt_from_string |
233 |
} |
234 |
); |
235 |
|
236 |
is( $message, "Success.", "ProcessOfflineIssue returns success message" ); |
237 |
isa_ok( $checkout, 'Koha::Checkout', "ProcessOfflineIssue returns checkout object" ); |
238 |
is( $checkout->borrowernumber, $borrower->{borrowernumber}, "Checkout has correct borrower" ); |
239 |
is( dt_from_string( $checkout->date_due )->ymd, $due_date, "Checkout respects specified due_date" ); |
240 |
}; |
241 |
|
200 |
$schema->storage->txn_rollback; |
242 |
$schema->storage->txn_rollback; |