From 0807e4faeec3492f42ff7010e35f9e05783293e5 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Fri, 11 Nov 2022 09:24:37 +0200 Subject: [PATCH 4/4] Bug 9525: Fix tests To test prove t/db_dependent/Koha/Libraries.t Sponsored-by: Koha-Suomi Oy --- t/db_dependent/Koha/Libraries.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Koha/Libraries.t b/t/db_dependent/Koha/Libraries.t index 419dcbf0da..c2477c2f97 100755 --- a/t/db_dependent/Koha/Libraries.t +++ b/t/db_dependent/Koha/Libraries.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 12; +use Test::More tests => 13; use C4::Biblio; use C4::Context; @@ -342,8 +342,8 @@ subtest 'get_float_libraries and validate_float_sibling' => sub { my $library3 = $builder->build_object({ class => 'Koha::Libraries' }); my $library4 = $builder->build_object({ class => 'Koha::Libraries' }); - my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); - my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_hold_group => 1 } } ); + my $root1 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_float_group => 1 } } ); + my $root2 = $builder->build_object( { class => 'Koha::Library::Groups', value => { ft_local_float_group => 1 } } ); # Float group 1 $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library1->branchcode } } ); $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root1->id, branchcode => $library2->branchcode } } ); @@ -351,10 +351,10 @@ subtest 'get_float_libraries and validate_float_sibling' => sub { $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library3->branchcode } } ); $builder->build_object( { class => 'Koha::Library::Groups', value => { parent_id => $root2->id, branchcode => $library4->branchcode } } ); - my @libraries1 = $library1->get_float_libraries(); + my @libraries1 = $library1->get_float_libraries()->as_list; is(scalar @libraries1, '2', '1st float group contains 2 libraries'); - my @libraries2 = $library3->get_float_libraries(); + my @libraries2 = $library3->get_float_libraries()->as_list; is(scalar @libraries2, '2', '2nd float group also contains 2 libraries'); ok($library1->validate_float_sibling({ branchcode => $library2->branchcode }), "Library1 and library2 belong in to the same float group."); -- 2.34.1