@@ -, +, @@ child to adult is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category'); --- t/db_dependent/Patrons.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/t/db_dependent/Patrons.t +++ a/t/db_dependent/Patrons.t @@ -106,7 +106,7 @@ foreach my $b ( $patrons->as_list() ) { } subtest "Update patron categories" => sub { - plan tests => 20; + plan tests => 21; t::lib::Mocks::mock_preference( 'borrowerRelationship', 'test' ); my $c_categorycode = $builder->build({ source => 'Category', value => { category_type=>'C', @@ -191,9 +191,12 @@ subtest "Update patron categories" => sub { is( Koha::Patrons->search_patrons_to_update_category({from=>$a_categorycode,fine_max=>5})->count,2,'Two patrons with fines under $5, patron with no fine history is found'); is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantor has 3 guarantees'); + 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'); is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantees not removed when made changing child categories'); + is( Koha::Patrons->search_patrons_to_update_category({from=>$c_categorycode_2,too_young=>1})->update_category_to({category=>$a_categorycode}),1,'One child patron updated to adult category'); + is( Koha::Patrons->find($child3->borrowernumber)->categorycode,$a_categorycode,'The over age patron has been updated to adult category'); is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult'); is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees'); --