From 6afed04f286619a6d04be9506d369f2fe172897a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 1 Jun 2018 11:39:52 -0300 Subject: [PATCH] Bug 20838: Add 2 small tests to check ref --- t/db_dependent/LibraryGroups.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/LibraryGroups.t b/t/db_dependent/LibraryGroups.t index 02e9817948..9c162f09bc 100644 --- a/t/db_dependent/LibraryGroups.t +++ b/t/db_dependent/LibraryGroups.t @@ -4,7 +4,7 @@ use Modern::Perl; use List::MoreUtils 'any'; -use Test::More tests => 17; +use Test::More tests => 19; use t::lib::TestBuilder; @@ -120,7 +120,9 @@ my $groupX2_library6 = Koha::Library::Group->new({ parent_id => $groupX2->id, b my @branchcodes = sort( $library1->{branchcode}, $library2->{branchcode} ); my @group_branchcodes = sort( map { $_->branchcode } $groupX->libraries->as_list ); is_deeply( \@branchcodes, \@group_branchcodes, "Group libraries are returned correctly" ); +is( ref($groupX->libraries), 'Koha::Libraries', '->libraries should return a Koha::Libraries iterator' ); @branchcodes = sort( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode}, $library4->{branchcode}, $library5->{branchcode}, $library6->{branchcode} ); @group_branchcodes = sort( map { $_->branchcode } $groupX->all_libraries ); is_deeply( \@branchcodes, \@group_branchcodes, "Group all_libraries are returned correctly" ); +is( ref(($groupX->all_libraries)[0]), 'Koha::Library', '->all_libraries should returned a list of Koha::Library - it should actually return a Koha::Libraries iterator instead'); # FIXME -- 2.11.0