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

(-)a/t/db_dependent/Koha/Biblio.t (-10 / +16 lines)
Lines 185-191 subtest 'is_serial() tests' => sub { Link Here
185
};
185
};
186
186
187
subtest 'pickup_locations' => sub {
187
subtest 'pickup_locations' => sub {
188
    plan tests => 8;
188
    plan tests => 9;
189
189
190
    $schema->storage->txn_begin;
190
    $schema->storage->txn_begin;
191
191
Lines 205-218 subtest 'pickup_locations' => sub { Link Here
205
    my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
205
    my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
206
    my $root3 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
206
    my $root3 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } );
207
207
208
    my $library1 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
208
    my $library1 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1, branchname => 'zzz' } } );
209
    my $library2 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
209
    my $library2 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1, branchname => 'AAA' } } );
210
    my $library3 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 0 } } );
210
    my $library3 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 0, branchname => 'FFF' } } );
211
    my $library4 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
211
    my $library4 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1, branchname => 'CCC' } } );
212
    my $library5 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
212
    my $library5 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1, branchname => 'eee' } } );
213
    my $library6 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
213
    my $library6 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1, branchname => 'BBB' } } );
214
    my $library7 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
214
    my $library7 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1, branchname => 'DDD' } } );
215
    my $library8 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 0 } } );
215
    my $library8 = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 0, branchname => 'GGG' } } );
216
216
217
    our @branchcodes = map { $_->branchcode } ($library1, $library2, $library3, $library4, $library5, $library6, $library7, $library8);
217
    our @branchcodes = map { $_->branchcode } ($library1, $library2, $library3, $library4, $library5, $library6, $library7, $library8);
218
218
Lines 413-418 subtest 'pickup_locations' => sub { Link Here
413
        }
413
        }
414
    }
414
    }
415
415
416
    my @pl_names = map { $_->branchname } $biblio1->pickup_locations( { patron => $patron1 } )->as_list;
417
    my $pl_ori_str = join('|', @pl_names);
418
    my $pl_sorted_str = join('|', sort { lc($a) cmp lc($b) } @pl_names);
419
    ok(
420
        $pl_ori_str eq $pl_sorted_str,
421
        'Libraries must be sorted by name'
422
    );
416
    $schema->storage->txn_rollback;
423
    $schema->storage->txn_rollback;
417
};
424
};
418
425
419
- 

Return to bug 28202