View | Details | Raw Unified | Return to bug 27554
Collapse All | Expand All

(-)a/t/db_dependent/Patrons.t (-2 / +4 lines)
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 => 20;
109
    plan tests => 21;
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 191-199 subtest "Update patron categories" => sub { Link Here
191
    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');
191
    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');
192
192
193
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantor has 3 guarantees');
193
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantor has 3 guarantees');
194
194
    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');
195
    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');
195
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantees not removed when made changing child categories');
196
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,3,'Guarantees not removed when made changing child categories');
197
196
    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');
198
    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');
199
    is( Koha::Patrons->find($child3->borrowernumber)->categorycode,$a_categorycode,'The over age patron has been updated to adult category');
197
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult');
200
    is( Koha::Patrons->find($adult1->borrowernumber)->guarantee_relationships->guarantees->count,2,'Guarantee was removed when made adult');
198
201
199
    is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees');
202
    is( Koha::Patrons->find($inst->borrowernumber)->guarantee_relationships->guarantees->count,1,'Guarantor has 1 guarantees');
200
- 

Return to bug 27554