Lines 106-112
foreach my $b ( $patrons->as_list() ) {
Link Here
|
106 |
} |
106 |
} |
107 |
|
107 |
|
108 |
subtest "Update patron categories" => sub { |
108 |
subtest "Update patron categories" => sub { |
109 |
plan tests => 19; |
109 |
plan tests => 20; |
110 |
t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); |
110 |
t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); |
111 |
my $c_categorycode = $builder->build({ source => 'Category', value => { |
111 |
my $c_categorycode = $builder->build({ source => 'Category', value => { |
112 |
category_type=>'C', |
112 |
category_type=>'C', |
Lines 182-187
subtest "Update patron categories" => sub {
Link Here
|
182 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_min=>5})->next->borrowernumber,$adult2->borrowernumber,'One patron with fines over $5 is expected one'); |
182 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_min=>5})->next->borrowernumber,$adult2->borrowernumber,'One patron with fines over $5 is expected one'); |
183 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_max=>5})->count,1,'One patron with fines under $5'); |
183 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_max=>5})->count,1,'One patron with fines under $5'); |
184 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_max=>5})->next->borrowernumber,$adult1->borrowernumber,'One patron with fines under $5 is expected one'); |
184 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_max=>5})->next->borrowernumber,$adult1->borrowernumber,'One patron with fines under $5 is expected one'); |
|
|
185 |
$adult1->account->add_credit({ amount => 4.99, interface => 'test' }); |
186 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_max=>5})->count,0,'No patron with fines under $5'); |
185 |
|
187 |
|
186 |
is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantor has 3 guarantees'); |
188 |
is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantor has 3 guarantees'); |
187 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode})->update_category_to({category=>$c_categorycode_2}),3,'Three child patrons updated to another child category with no params passed'); |
189 |
is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode})->update_category_to({category=>$c_categorycode_2}),3,'Three child patrons updated to another child category with no params passed'); |
188 |
- |
|
|