Lines 80-86
subtest 'Checkout V2' => sub {
Link Here
|
80 |
subtest 'Test checkout desensitize' => sub { |
80 |
subtest 'Test checkout desensitize' => sub { |
81 |
my $schema = Koha::Database->new->schema; |
81 |
my $schema = Koha::Database->new->schema; |
82 |
$schema->storage->txn_begin; |
82 |
$schema->storage->txn_begin; |
83 |
plan tests => 3; |
83 |
plan tests => 6; |
84 |
$C4::SIP::Sip::protocol_version = 2; |
84 |
$C4::SIP::Sip::protocol_version = 2; |
85 |
test_checkout_desensitize(); |
85 |
test_checkout_desensitize(); |
86 |
$schema->storage->txn_rollback; |
86 |
$schema->storage->txn_rollback; |
Lines 89-95
subtest 'Test checkout desensitize' => sub {
Link Here
|
89 |
subtest 'Test renew desensitize' => sub { |
89 |
subtest 'Test renew desensitize' => sub { |
90 |
my $schema = Koha::Database->new->schema; |
90 |
my $schema = Koha::Database->new->schema; |
91 |
$schema->storage->txn_begin; |
91 |
$schema->storage->txn_begin; |
92 |
plan tests => 3; |
92 |
plan tests => 6; |
93 |
$C4::SIP::Sip::protocol_version = 2; |
93 |
$C4::SIP::Sip::protocol_version = 2; |
94 |
test_renew_desensitize(); |
94 |
test_renew_desensitize(); |
95 |
$schema->storage->txn_rollback; |
95 |
$schema->storage->txn_rollback; |
Lines 899-904
sub test_checkout_desensitize {
Link Here
|
899 |
homebranch => $branchcode, |
899 |
homebranch => $branchcode, |
900 |
holdingbranch => $branchcode, |
900 |
holdingbranch => $branchcode, |
901 |
}); |
901 |
}); |
|
|
902 |
my $itemtype = $item_object->effective_itemtype; |
902 |
|
903 |
|
903 |
my $mockILS = $mocks->{ils}; |
904 |
my $mockILS = $mocks->{ils}; |
904 |
my $server = { ils => $mockILS, account => {} }; |
905 |
my $server = { ils => $mockILS, account => {} }; |
Lines 937-942
sub test_checkout_desensitize {
Link Here
|
937 |
$msg->handle_checkout( $server ); |
938 |
$msg->handle_checkout( $server ); |
938 |
$respcode = substr( $response, 5, 1 ); |
939 |
$respcode = substr( $response, 5, 1 ); |
939 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" ); |
940 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" ); |
|
|
941 |
|
942 |
$server->{account}->{inhouse_patron_categories} = ""; |
943 |
|
944 |
undef $response; |
945 |
$server->{account}->{inhouse_item_types} = "A,$itemtype,Z"; |
946 |
$msg->handle_checkout( $server ); |
947 |
$respcode = substr( $response, 5, 1 ); |
948 |
is( $respcode, 'N', "Desensitize flag was not set for itemtype in inhouse_item_types" ); |
949 |
|
950 |
undef $response; |
951 |
$server->{account}->{inhouse_item_types} = "A,B,C"; |
952 |
$msg->handle_checkout( $server ); |
953 |
$respcode = substr( $response, 5, 1 ); |
954 |
is( $respcode, 'Y', "Desensitize flag was set for item type not in inhouse_item_types" ); |
955 |
|
956 |
undef $response; |
957 |
$server->{account}->{inhouse_item_types} = ""; |
958 |
$msg->handle_checkout( $server ); |
959 |
$respcode = substr( $response, 5, 1 ); |
960 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_item_types" ); |
940 |
} |
961 |
} |
941 |
|
962 |
|
942 |
sub test_renew_desensitize { |
963 |
sub test_renew_desensitize { |
Lines 964-969
sub test_renew_desensitize {
Link Here
|
964 |
homebranch => $branchcode, |
985 |
homebranch => $branchcode, |
965 |
holdingbranch => $branchcode, |
986 |
holdingbranch => $branchcode, |
966 |
}); |
987 |
}); |
|
|
988 |
my $itemtype = $item_object->effective_itemtype; |
967 |
|
989 |
|
968 |
my $mockILS = $mocks->{ils}; |
990 |
my $mockILS = $mocks->{ils}; |
969 |
my $server = { ils => $mockILS, account => {} }; |
991 |
my $server = { ils => $mockILS, account => {} }; |
Lines 1003-1008
sub test_renew_desensitize {
Link Here
|
1003 |
$msg->handle_checkout( $server ); |
1025 |
$msg->handle_checkout( $server ); |
1004 |
$respcode = substr( $response, 5, 1 ); |
1026 |
$respcode = substr( $response, 5, 1 ); |
1005 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" ); |
1027 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" ); |
|
|
1028 |
|
1029 |
$server->{account}->{inhouse_patron_categories} = ""; |
1030 |
|
1031 |
undef $response; |
1032 |
$server->{account}->{inhouse_item_types} = "A,B,C"; |
1033 |
$msg->handle_checkout( $server ); |
1034 |
$respcode = substr( $response, 5, 1 ); |
1035 |
is( $respcode, 'Y', "Desensitize flag was set for item type not in inhouse_item_types" ); |
1036 |
|
1037 |
undef $response; |
1038 |
$server->{account}->{inhouse_item_types} = ""; |
1039 |
$msg->handle_checkout( $server ); |
1040 |
$respcode = substr( $response, 5, 1 ); |
1041 |
is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_item_types" ); |
1042 |
|
1043 |
undef $response; |
1044 |
$server->{account}->{inhouse_item_types} = "A,$itemtype,Z"; |
1045 |
$msg->handle_checkout( $server ); |
1046 |
$respcode = substr( $response, 5, 1 ); |
1047 |
is( $respcode, 'N', "Desensitize flag was not set for itemtype in inhouse_item_types" ); |
1048 |
|
1006 |
} |
1049 |
} |
1007 |
|
1050 |
|
1008 |
# Helper routines |
1051 |
# Helper routines |
1009 |
- |
|
|