Lines 4-10
use Modern::Perl;
Link Here
|
4 |
|
4 |
|
5 |
use List::MoreUtils 'any'; |
5 |
use List::MoreUtils 'any'; |
6 |
|
6 |
|
7 |
use Test::More tests => 17; |
7 |
use Test::More tests => 19; |
8 |
|
8 |
|
9 |
use t::lib::TestBuilder; |
9 |
use t::lib::TestBuilder; |
10 |
|
10 |
|
Lines 120-126
my $groupX2_library6 = Koha::Library::Group->new({ parent_id => $groupX2->id, b
Link Here
|
120 |
my @branchcodes = sort( $library1->{branchcode}, $library2->{branchcode} ); |
120 |
my @branchcodes = sort( $library1->{branchcode}, $library2->{branchcode} ); |
121 |
my @group_branchcodes = sort( map { $_->branchcode } $groupX->libraries->as_list ); |
121 |
my @group_branchcodes = sort( map { $_->branchcode } $groupX->libraries->as_list ); |
122 |
is_deeply( \@branchcodes, \@group_branchcodes, "Group libraries are returned correctly" ); |
122 |
is_deeply( \@branchcodes, \@group_branchcodes, "Group libraries are returned correctly" ); |
|
|
123 |
is( ref($groupX->libraries), 'Koha::Libraries', '->libraries should return a Koha::Libraries iterator' ); |
123 |
|
124 |
|
124 |
@branchcodes = sort( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode}, $library4->{branchcode}, $library5->{branchcode}, $library6->{branchcode} ); |
125 |
@branchcodes = sort( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode}, $library4->{branchcode}, $library5->{branchcode}, $library6->{branchcode} ); |
125 |
@group_branchcodes = sort( map { $_->branchcode } $groupX->all_libraries ); |
126 |
@group_branchcodes = sort( map { $_->branchcode } $groupX->all_libraries ); |
126 |
is_deeply( \@branchcodes, \@group_branchcodes, "Group all_libraries are returned correctly" ); |
127 |
is_deeply( \@branchcodes, \@group_branchcodes, "Group all_libraries are returned correctly" ); |
127 |
- |
128 |
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 |