|
Lines 18-24
Link Here
|
| 18 |
|
18 |
|
| 19 |
use Modern::Perl; |
19 |
use Modern::Perl; |
| 20 |
|
20 |
|
| 21 |
use Test::More tests => 14; |
21 |
use Test::More tests => 15; |
| 22 |
|
22 |
|
| 23 |
use C4::Context; |
23 |
use C4::Context; |
| 24 |
use Koha::Database; |
24 |
use Koha::Database; |
|
Lines 73-78
is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and not exists $_->{selected} } @$
Link Here
|
| 73 |
$libraries = $plugin->all( { selected => 'ANOTHERLIB' } ); |
73 |
$libraries = $plugin->all( { selected => 'ANOTHERLIB' } ); |
| 74 |
is( grep ( { $_->{branchcode} eq 'MYLIBRARY' and not exists $_->{selected} } @$libraries ), 1, 'With selected parameter, my library should not be preselected' ); |
74 |
is( grep ( { $_->{branchcode} eq 'MYLIBRARY' and not exists $_->{selected} } @$libraries ), 1, 'With selected parameter, my library should not be preselected' ); |
| 75 |
is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and $_->{selected} == 1 } @$libraries ), 1, 'With selected parameter, other library should be preselected' ); |
75 |
is( grep ( { $_->{branchcode} eq 'ANOTHERLIB' and $_->{selected} == 1 } @$libraries ), 1, 'With selected parameter, other library should be preselected' ); |
|
|
76 |
$libraries = $plugin->all( { selected => '' } ); |
| 77 |
is( grep ( { exists $_->{selected} } @$libraries ), 0, 'With selected parameter set to an empty string, no library should be preselected' ); |
| 76 |
|
78 |
|
| 77 |
C4::Context->set_preference( 'IndependentBranches', 1 ); |
79 |
C4::Context->set_preference( 'IndependentBranches', 1 ); |
| 78 |
$libraries = $plugin->all(); |
80 |
$libraries = $plugin->all(); |
| 79 |
- |
|
|