Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
|
21 |
|
22 |
use Test::More tests => 32; |
22 |
use Test::More tests => 33; |
23 |
use Test::Warn; |
23 |
use Test::Warn; |
24 |
use Test::Exception; |
24 |
use Test::Exception; |
25 |
use Time::Fake; |
25 |
use Time::Fake; |
Lines 421-426
subtest "delete" => sub {
Link Here
|
421 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->delete should have logged' ); |
421 |
is( $number_of_logs, 1, 'With BorrowerLogs, Koha::Patron->delete should have logged' ); |
422 |
}; |
422 |
}; |
423 |
|
423 |
|
|
|
424 |
subtest 'Koha::Patrons->delete' => sub { |
425 |
plan tests => 3; |
426 |
my $patron1 = $builder->build_object({ class => 'Koha::Patrons' }); |
427 |
my $patron2 = $builder->build_object({ class => 'Koha::Patrons' }); |
428 |
my $id1 = $patron1->borrowernumber; |
429 |
my $set = Koha::Patrons->search({ borrowernumber => { '>=' => $id1 }}); |
430 |
is( $set->count, 2, 'Two patrons found as expected' ); |
431 |
my $count1 = $schema->resultset('Deletedborrower')->count; |
432 |
is( $set->delete, 1, 'Two patrons deleted' ); |
433 |
my $count2 = $schema->resultset('Deletedborrower')->count; |
434 |
is( $count2, $count1 + 2, 'Patrons moved to deletedborrowers' ); |
435 |
}; |
436 |
|
424 |
subtest 'add_enrolment_fee_if_needed' => sub { |
437 |
subtest 'add_enrolment_fee_if_needed' => sub { |
425 |
plan tests => 4; |
438 |
plan tests => 4; |
426 |
|
439 |
|
427 |
- |
|
|