Lines 1032-1041
subtest 'Test guarantor handling in SendQueuedMessages' => sub {
Link Here
|
1032 |
plan tests => 19; |
1032 |
plan tests => 19; |
1033 |
|
1033 |
|
1034 |
t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); |
1034 |
t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); |
|
|
1035 |
t::lib::Mocks::mock_preference( 'ChildNeedsGuarantor', 1 ); |
1035 |
|
1036 |
|
1036 |
my $patron = Koha::Patrons->find($borrowernumber); |
1037 |
my $patron = Koha::Patrons->find($borrowernumber); |
1037 |
my $guarantor1 = $builder->build_object( { class => 'Koha::Patrons', value => { email => 'g1@email.com' } } ); |
1038 |
|
1038 |
my $guarantor2 = $builder->build_object( { class => 'Koha::Patrons', value => { email => 'g2@email.com' } } ); |
1039 |
my $patron_category = |
|
|
1040 |
$builder->build( { source => 'Category', value => { category_type => 'A', can_be_guarantee => 0 } } ) |
1041 |
->{categorycode}; |
1042 |
my $guarantor1 = $builder->build_object( |
1043 |
{ class => 'Koha::Patrons', value => { email => 'g1@email.com', categorycode => $patron_category } } ); |
1044 |
my $guarantor2 = $builder->build_object( |
1045 |
{ class => 'Koha::Patrons', value => { email => 'g2@email.com', categorycode => $patron_category } } ); |
1046 |
|
1039 |
$patron->add_guarantor( { guarantor_id => $guarantor1->borrowernumber, relationship => 'test' } ); |
1047 |
$patron->add_guarantor( { guarantor_id => $guarantor1->borrowernumber, relationship => 'test' } ); |
1040 |
$patron->add_guarantor( { guarantor_id => $guarantor2->borrowernumber, relationship => 'test' } ); |
1048 |
$patron->add_guarantor( { guarantor_id => $guarantor2->borrowernumber, relationship => 'test' } ); |
1041 |
|
1049 |
|