use C4::Auth qw(checkpw_hash);
use Koha::Holds;
+use Koha::Old::Holds;
use Koha::Patrons;
use Koha::Patron::Categories;
use Koha::Database;
};
subtest "delete" => sub {
- plan tests => 5;
+ plan tests => 6;
t::lib::Mocks::mock_preference( 'BorrowersLog', 1 );
my $patron = $builder->build( { source => 'Borrower' } );
my $retrieved_patron = Koha::Patrons->find( $patron->{borrowernumber} );
is( Koha::Patrons->find( $patron->{borrowernumber} ), undef, 'Koha::Patron->delete should have deleted the patron' );
+ is (Koha::Old::Holds->search( { reserve_id => $hold->{ reserve_id } } )->count, 1, q|Koha::Patron->delete should have cancelled patron's holds| );
+
is( Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } )->count, 0, q|Koha::Patron->delete should have deleted patron's holds| );
is( Koha::Virtualshelves->search( { owner => $patron->{borrowernumber} } )->count, 0, q|Koha::Patron->delete should have deleted patron's lists| );