|
Lines 35-40
use C4::Circulation qw( AddIssue AddReturn );
Link Here
|
| 35 |
use Koha::Database; |
35 |
use Koha::Database; |
| 36 |
use Koha::AuthUtils qw(hash_password); |
36 |
use Koha::AuthUtils qw(hash_password); |
| 37 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
37 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
|
|
38 |
use Koha::CirculationRules; |
| 38 |
use Koha::Items; |
39 |
use Koha::Items; |
| 39 |
use Koha::Checkouts; |
40 |
use Koha::Checkouts; |
| 40 |
use Koha::Old::Checkouts; |
41 |
use Koha::Old::Checkouts; |
|
Lines 380-385
subtest "Test build_custom_field_string" => sub {
Link Here
|
| 380 |
}; |
381 |
}; |
| 381 |
|
382 |
|
| 382 |
subtest "Test cr_item_field" => sub { |
383 |
subtest "Test cr_item_field" => sub { |
|
|
384 |
my $schema = Koha::Database->new->schema; |
| 385 |
$schema->storage->txn_begin; |
| 386 |
|
| 383 |
plan tests => 8; |
387 |
plan tests => 8; |
| 384 |
|
388 |
|
| 385 |
my $builder = t::lib::TestBuilder->new(); |
389 |
my $builder = t::lib::TestBuilder->new(); |
|
Lines 483-488
subtest "Test cr_item_field" => sub {
Link Here
|
| 483 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
487 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
| 484 |
$msg->handle_item_information( $server ); |
488 |
$msg->handle_item_information( $server ); |
| 485 |
ok( $response =~ m/AH1999-01-01 12:59/, "Found correct CR field in response"); |
489 |
ok( $response =~ m/AH1999-01-01 12:59/, "Found correct CR field in response"); |
|
|
490 |
|
| 491 |
$schema->storage->txn_rollback; |
| 486 |
}; |
492 |
}; |
| 487 |
|
493 |
|
| 488 |
subtest 'Patron info summary > 5 should not crash server' => sub { |
494 |
subtest 'Patron info summary > 5 should not crash server' => sub { |
|
Lines 575-580
subtest 'SC status tests' => sub {
Link Here
|
| 575 |
|
581 |
|
| 576 |
dies_ok{ $msg->handle_sc_status( $server ) } ,"Dies if sip user cannot be found"; |
582 |
dies_ok{ $msg->handle_sc_status( $server ) } ,"Dies if sip user cannot be found"; |
| 577 |
|
583 |
|
|
|
584 |
$schema->storage->txn_rollback; |
| 578 |
}; |
585 |
}; |
| 579 |
|
586 |
|
| 580 |
# Here is room for some more subtests |
587 |
# Here is room for some more subtests |
|
Lines 761-766
sub test_checkout_v2 {
Link Here
|
| 761 |
my ( $response, $findpatron ); |
768 |
my ( $response, $findpatron ); |
| 762 |
my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); |
769 |
my $mocks = create_mocks( \$response, \$findpatron, \$branchcode ); |
| 763 |
|
770 |
|
|
|
771 |
|
| 772 |
|
| 764 |
# create some data |
773 |
# create some data |
| 765 |
my $patron1 = $builder->build({ |
774 |
my $patron1 = $builder->build({ |
| 766 |
source => 'Borrower', |
775 |
source => 'Borrower', |
|
Lines 1262-1267
sub create_mocks {
Link Here
|
| 1262 |
$mockILS->mock( 'institution_id', sub { $$branchcode; } ); |
1271 |
$mockILS->mock( 'institution_id', sub { $$branchcode; } ); |
| 1263 |
$mockILS->mock( 'find_patron', sub { $$findpatron; } ); |
1272 |
$mockILS->mock( 'find_patron', sub { $$findpatron; } ); |
| 1264 |
|
1273 |
|
|
|
1274 |
Koha::CirculationRules->set_rule( |
| 1275 |
{ |
| 1276 |
categorycode => undef, |
| 1277 |
itemtype => undef, |
| 1278 |
branchcode => undef, |
| 1279 |
rule_name => 'renewalsallowed', |
| 1280 |
rule_value => '5', |
| 1281 |
} |
| 1282 |
); |
| 1283 |
|
| 1265 |
return { ils => $mockILS, message => $mockMsg }; |
1284 |
return { ils => $mockILS, message => $mockMsg }; |
| 1266 |
} |
1285 |
} |
| 1267 |
|
1286 |
|
| 1268 |
- |
|
|