Lines 16-22
Link Here
|
16 |
|
16 |
|
17 |
use Modern::Perl; |
17 |
use Modern::Perl; |
18 |
|
18 |
|
19 |
use Test::More tests => 15; |
19 |
use Test::More tests => 17; |
20 |
|
20 |
|
21 |
use C4::Context; |
21 |
use C4::Context; |
22 |
use Koha::Database; |
22 |
use Koha::Database; |
Lines 75-80
is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and $_->{selected} == 1 } @$librar
Link Here
|
75 |
$libraries = $plugin->all( { selected => '' } ); |
75 |
$libraries = $plugin->all( { selected => '' } ); |
76 |
is( grep ( { exists $_->{selected} } @$libraries ), 0, 'With selected parameter set to an empty string, no library should be preselected' ); |
76 |
is( grep ( { exists $_->{selected} } @$libraries ), 0, 'With selected parameter set to an empty string, no library should be preselected' ); |
77 |
|
77 |
|
|
|
78 |
my $total = @{$plugin->all}; |
79 |
my $pickupable = @{$plugin->pickup_locations}; |
80 |
my $yet_another_library = $builder->build({ |
81 |
source => 'Branch', |
82 |
value => { |
83 |
branchcode => 'CANTPICKUP', |
84 |
pickup_location => 0, |
85 |
} |
86 |
}); |
87 |
is(@{$plugin->pickup_locations}, $pickupable, 'Adding a new library with pickups' |
88 |
.' disabled does not increase the amount returned by ->pickup_locations'); |
89 |
is(@{$plugin->all}, $total+1, 'However, adding a new library increases' |
90 |
.' the total amount gotten with ->all'); |
91 |
|
78 |
t::lib::Mocks::mock_preference( 'IndependentBranches', 1 ); |
92 |
t::lib::Mocks::mock_preference( 'IndependentBranches', 1 ); |
79 |
$libraries = $plugin->all(); |
93 |
$libraries = $plugin->all(); |
80 |
is( scalar(@$libraries), 1, 'If IndependentBranches is set, only 1 library should be returned' ); |
94 |
is( scalar(@$libraries), 1, 'If IndependentBranches is set, only 1 library should be returned' ); |
81 |
- |
|
|