Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 12; |
22 |
use Test::More tests => 13; |
23 |
|
23 |
|
24 |
use C4::Biblio; |
24 |
use C4::Biblio; |
25 |
use C4::Context; |
25 |
use C4::Context; |
Lines 342-349
subtest 'get_float_libraries and validate_float_sibling' => sub {
Link Here
|
342 |
my $library3 = $builder->build_object({ class => 'Koha::Libraries' }); |
342 |
my $library3 = $builder->build_object({ class => 'Koha::Libraries' }); |
343 |
my $library4 = $builder->build_object({ class => 'Koha::Libraries' }); |
343 |
my $library4 = $builder->build_object({ class => 'Koha::Libraries' }); |
344 |
|
344 |
|
345 |
my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); |
345 |
my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_float_group => 1 } } ); |
346 |
my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); |
346 |
my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_float_group => 1 } } ); |
347 |
# Float group 1 |
347 |
# Float group 1 |
348 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library1->branchcode } } ); |
348 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library1->branchcode } } ); |
349 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library2->branchcode } } ); |
349 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library2->branchcode } } ); |
Lines 351-360
subtest 'get_float_libraries and validate_float_sibling' => sub {
Link Here
|
351 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library3->branchcode } } ); |
351 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library3->branchcode } } ); |
352 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library4->branchcode } } ); |
352 |
$builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library4->branchcode } } ); |
353 |
|
353 |
|
354 |
my @libraries1 = $library1->get_float_libraries(); |
354 |
my @libraries1 = $library1->get_float_libraries()->as_list; |
355 |
is(scalar @libraries1, '2', '1st float group contains 2 libraries'); |
355 |
is(scalar @libraries1, '2', '1st float group contains 2 libraries'); |
356 |
|
356 |
|
357 |
my @libraries2 = $library3->get_float_libraries(); |
357 |
my @libraries2 = $library3->get_float_libraries()->as_list; |
358 |
is(scalar @libraries2, '2', '2nd float group also contains 2 libraries'); |
358 |
is(scalar @libraries2, '2', '2nd float group also contains 2 libraries'); |
359 |
|
359 |
|
360 |
ok($library1->validate_float_sibling({ branchcode => $library2->branchcode }), "Library1 and library2 belong in to the same float group."); |
360 |
ok($library1->validate_float_sibling({ branchcode => $library2->branchcode }), "Library1 and library2 belong in to the same float group."); |
361 |
- |
|
|