|
Lines 17-23
Link Here
|
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 47; |
20 |
use Test::More tests => 48; |
| 21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
| 22 |
use Test::Exception; |
22 |
use Test::Exception; |
| 23 |
|
23 |
|
|
Lines 248-258
$builder->build({
Link Here
|
| 248 |
# IndependentBranches is off. |
248 |
# IndependentBranches is off. |
| 249 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
249 |
t::lib::Mocks::mock_preference('IndependentBranches', 0); |
| 250 |
|
250 |
|
|
|
251 |
my $anonymous_patron = Koha::Patron->new({ categorycode => 'CIVILIAN', branchcode => $library2->{branchcode} })->store->borrowernumber; |
| 252 |
t::lib::Mocks::mock_preference('AnonymousPatron', $anonymous_patron); |
| 253 |
|
| 251 |
my $owner = Koha::Patron->new({ categorycode => 'STAFFER', branchcode => $library2->{branchcode} })->store->borrowernumber; |
254 |
my $owner = Koha::Patron->new({ categorycode => 'STAFFER', branchcode => $library2->{branchcode} })->store->borrowernumber; |
| 252 |
my $list1 = AddPatronList( { name => 'Test List 1', owner => $owner } ); |
255 |
my $list1 = AddPatronList( { name => 'Test List 1', owner => $owner } ); |
|
|
256 |
|
| 257 |
AddPatronsToList( { list => $list1, borrowernumbers => [$anonymous_patron] } ); |
| 258 |
my $patstodel = GetBorrowersToExpunge( { patron_list_id => $list1->patron_list_id() } ); |
| 259 |
is( scalar(@$patstodel), 0, 'Anonymous Patron not deleted from list' ); |
| 260 |
|
| 253 |
my @listpatrons = ($bor1inlist, $bor2inlist); |
261 |
my @listpatrons = ($bor1inlist, $bor2inlist); |
| 254 |
AddPatronsToList( { list => $list1, borrowernumbers => \@listpatrons }); |
262 |
AddPatronsToList( { list => $list1, borrowernumbers => \@listpatrons }); |
| 255 |
my $patstodel = GetBorrowersToExpunge( {patron_list_id => $list1->patron_list_id() } ); |
263 |
$patstodel = GetBorrowersToExpunge( {patron_list_id => $list1->patron_list_id() } ); |
| 256 |
is( scalar(@$patstodel),0,'No staff deleted from list of all staff'); |
264 |
is( scalar(@$patstodel),0,'No staff deleted from list of all staff'); |
| 257 |
Koha::Patrons->find($bor2inlist)->set({ categorycode => 'CIVILIAN' })->store; |
265 |
Koha::Patrons->find($bor2inlist)->set({ categorycode => 'CIVILIAN' })->store; |
| 258 |
$patstodel = GetBorrowersToExpunge( {patron_list_id => $list1->patron_list_id()} ); |
266 |
$patstodel = GetBorrowersToExpunge( {patron_list_id => $list1->patron_list_id()} ); |
| 259 |
- |
|
|