Lines 32-37
use C4::Biblio;
Link Here
|
32 |
use C4::Auth qw(checkpw_hash); |
32 |
use C4::Auth qw(checkpw_hash); |
33 |
|
33 |
|
34 |
use Koha::Holds; |
34 |
use Koha::Holds; |
|
|
35 |
use Koha::Old::Holds; |
35 |
use Koha::Patrons; |
36 |
use Koha::Patrons; |
36 |
use Koha::Patron::Categories; |
37 |
use Koha::Patron::Categories; |
37 |
use Koha::Database; |
38 |
use Koha::Database; |
Lines 369-375
subtest "move_to_deleted" => sub {
Link Here
|
369 |
}; |
370 |
}; |
370 |
|
371 |
|
371 |
subtest "delete" => sub { |
372 |
subtest "delete" => sub { |
372 |
plan tests => 5; |
373 |
plan tests => 6; |
373 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
374 |
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); |
374 |
my $patron = $builder->build( { source => 'Borrower' } ); |
375 |
my $patron = $builder->build( { source => 'Borrower' } ); |
375 |
my $retrieved_patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
376 |
my $retrieved_patron = Koha::Patrons->find( $patron->{borrowernumber} ); |
Lines 389-394
subtest "delete" => sub {
Link Here
|
389 |
|
390 |
|
390 |
is( Koha::Patrons->find( $patron->{borrowernumber} ), undef, 'Koha::Patron->delete should have deleted the patron' ); |
391 |
is( Koha::Patrons->find( $patron->{borrowernumber} ), undef, 'Koha::Patron->delete should have deleted the patron' ); |
391 |
|
392 |
|
|
|
393 |
is (Koha::Old::Holds->search( { reserve_id => $hold->{ reserve_id } } )->count, 1, q|Koha::Patron->delete should have cancelled patron's holds| ); |
394 |
|
392 |
is( Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } )->count, 0, q|Koha::Patron->delete should have deleted patron's holds| ); |
395 |
is( Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } )->count, 0, q|Koha::Patron->delete should have deleted patron's holds| ); |
393 |
|
396 |
|
394 |
is( Koha::Virtualshelves->search( { owner => $patron->{borrowernumber} } )->count, 0, q|Koha::Patron->delete should have deleted patron's lists| ); |
397 |
is( Koha::Virtualshelves->search( { owner => $patron->{borrowernumber} } )->count, 0, q|Koha::Patron->delete should have deleted patron's lists| ); |
395 |
- |
|
|