@@ -, +, @@ --- t/db_dependent/Koha/Patrons.t | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) --- a/t/db_dependent/Koha/Patrons.t +++ a/t/db_dependent/Koha/Patrons.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 33; +use Test::More tests => 34; use Test::Warn; use Test::Exception; use Test::MockModule; @@ -368,8 +368,18 @@ subtest "move_to_deleted" => sub { $retrieved_patron->delete( $patron->{borrowernumber} ); # Cleanup }; -subtest "delete" => sub { - plan tests => 5; +subtest "Koha::Patrons->search" => sub { + plan tests => 1; + + my $set = Koha::Patrons->search(); + my $count = $set->count; + my $reduced_set = $set->search({ borrowernumber => { '>' => 0 } }); + my $reduced_count = $reduced_set->count; + is ( $count, $reduced_count, "System users not found in Koha::Patrons->search"); +}; + +subtest "Koha::Patron->delete" => sub { + plan tests => 6; t::lib::Mocks::mock_preference( 'BorrowersLog', 1 ); my $patron = $builder->build( { source => 'Borrower' } ); my $retrieved_patron = Koha::Patrons->find( $patron->{borrowernumber} ); --